ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Agnew" <br...@oopsconsultancy.com>
Subject Re: XML
Date Mon, 09 Mar 2009 14:22:06 GMT
You can do something like this using XMLTask. e.g.

<target name="test">
  <xmltask source="a.xml">
    <call path="//*" target="callback">
      <param name="path" path="text()"/>
    </call>
  </xmltask>
</target>

<target name="callback">
  <echo>Found a node with text ${path}</echo>
</target>

The above will call the target 'callback' with the text content of each
node that is matched by the XPath expression //*.

See http://www.oopsconsultancy.com/software/xmltask/ and in particular the
documentation for the <call> instruction.

Brian

On Mon, March 9, 2009 13:00, Guy Catz wrote:
> Hi.
>
> Is it possible to iterate over a XML file? How can this be done?
>
> Thanks,
>  Guy.
>


-- 
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


Mime
View raw message