You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Brian Agnew <br...@yahoo.com> on 2002/04/27 13:05:09 UTC

XML manipulation task

Hello,

I've built a simple Ant task to handle XML manipulation. Since what I've needed
to do didn't require the complexity of XSLT, this task simply requires you to
specify the XML node you want to add/remove/append to, or change an attribute
on.

eg.

<xmltask source="input.xml" dest="output.xml report="true"">
  <replace path="/web/servlet/context/config/text()" withFile="config1.xml"/>
  <insert path="/web/security/" file="uat.security.xml"/>
  <remove path="/web/servlet/context/config/"/>
</xmltask>

You use XPath descriptors to specify the nodes. More examples, and the GPL
download are available at http://www.oopsconsultancy.com/software/xmltask.html.
Tested with JDK 1.3/1.4 and Ant 1.4.

Brian

=====
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd         brian@oopsconsultancy.com
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>