XMLTask

Information

xmltask provides the facility for automatically editing XML files as part of an Ant build. Unlike the standard filter task provided with Ant, it is XML-sensitive, but doesn't require you to define XSLTs.

Uses include:

Homepage: http://www.oopsconsultancy.com/software/xmltask/index.html

Example

There are 2 targets to help manipulate your XML files, one for replacing the text within an element and the other for replacing a value of an attribute ...

To use the xmltask.replace.text target, you need to set the properties described in the Common Build Targets document.

<target name="xmltask.replace.text"> <ant antfile="$" target="xmltask.replace.text"> <property name="xml.source" value="$" /> <property name="xml.dest" value="$" /> <property name="xml.xpath" value="application/description/text()" /> <property name="xml.replace.text" value="$" /> </ant> </target> To use the xmltask.attr.value target, you need to set the properties described in the Common Build Targets document. <target name="xmltask.attr.value"> <ant antfile="$" target="xmltask.attr.value"> <property name="xml.source" value="$" /> <property name="xml.dest" value="$" /> <property name="xml.xpath" value="wsdl:definitions/wsdl:service/wsdl:port/soap:address[@location]" /> <property name="xml.attr" value="location" /> <property name="xml.value" value="$" /> </ant> </target>


DeadEd.com
http://www.deaded.com/staticpages/index.php/xmltask