ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Agnew <brianag...@yahoo.com>
Subject XML manipulation task
Date Sat, 27 Apr 2002 11:05:09 GMT
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:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message