Reputation: 35
I'm trying to search and replace using below code.
<replaceregexp flags="g">
<regexp pattern="location="(.*?)""/>
<substitution expression="location="xsd/\1""/>
<fileset dir="${fmw.finalDir}/xsl" includes="*.xsl"/>
</replaceregexp>
It is working fine. But i want to know is there any way i can perform similar thing using "xmltask"
Upvotes: 1
Views: 1508
Reputation: 4319
With xmltask
you need to express the location to be replaced with xpath, so it really is only practical if you can do that easily.
Assuming it's the case for you, you can indeed follow the example on the XmlTask online documentation and write e.g.
<xmltask todir="${fmw.finalDir}/xsl">
<fileset dir="${fmw.finalDir}/xsl" includes="*.xsl"/>
<replace path="A/B/C[@location=""]/@location" withText="xsd"/>
</xmltask>
Upvotes: 1