ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephane Bailliez <>
Subject [PROPOSAL] XPath task
Date Mon, 23 Apr 2001 15:22:26 GMT

Following discussion w/ Scott and Jeff in alexandria-dev, I quickly wrote an
XPath task.

I'm not sure this is 'exactly' how it should be done...
this looks like more a feature of the replace task, but I also wanted the
multiple replace feature without parsing n times the xml document.

Use at as follows:

<xpath file="input.xml" tofile="output.xml">
	<apply select="/root/node/@attribute" value="newvalue"/>
	<apply select="/root/node/child/@attribute" value="newvalue"/>

or simply:

<xpath file="input.xml" select="/root/node/@attribute" value="newvalue"/>

So here is the XPath task, with testcase and doc.

I used the package
Feel free to change it to a more appropriate one (for instance if it is to
be used in cjan or alexandria).


 St├ęphane Bailliez 
 Software Engineer, Paris - France 
 iMediation - 
 Disclaimer: All the opinions expressed above are mine and not those from my

View raw message