ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Agnew <>
Subject XML manipulation task
Date Sat, 27 Apr 2002 11:05:09 GMT

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


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

You use XPath descriptors to specify the nodes. More examples, and the GPL
download are available at
Tested with JDK 1.3/1.4 and Ant 1.4.


Brian Agnew        
OOPS Consultancy Ltd
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

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message