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...@oopsconsultancy.com> on 2008/07/25 12:28:30 UTC

Re: How to read an XML file and extract values for the attributes using ANT script

XMLTask can do this.

http://www.oopsconsultancy.com/software/xmltask/

<xmltask source="source.xml">
<copy path="/TITLE/ABC/text()" property="prop1"/>
<copy path="/TITLE/XYZ/text()" property="prop2"/>
</xmltask>

will copy the values into the properties prop1/prop2

Brian


On Fri, July 25, 2008 10:36, Alpesh Vesuwala wrote:
>
> Hello Friends,
>
> I have an XML file to read from it and extract values of some attributes.
> These extracted values can further processed by the ANT script.
>
> The Sample XML File is:
>
> <TITLE>
> 	<ABC>abc</ABC>
> 	<XYZ>xyz</XYZ>
> </TITLE>
>
> I want to extract 'abc' and 'xyz' from this sample code. Please help me
> out,
> how can I do that?
>
> Thanks Alpesh
> --
> View this message in context:
> http://www.nabble.com/How-to-read-an-XML-file-and-extract-values-for-the-attributes-using-ANT-script-tp18648408p18648408.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>


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


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org