From: Matthew M. <ma...@ac...> - 2003-12-18 20:27:26
|
I'm looking at adding XML iteration support for either the <foreach> task or perhaps a new, yet-unnamed task. I would like to be able to iterate over a file based on an XPath query, picking up each matching element or attribute in turn. <foreach> is the easiest place to add it, but it's not really a clean solution. A better way would be to model a new <xmlforeach> task on the existing xmlpeek/xmlpoke tasks like so: <xmlforeach file="foo.xml" xpath="/configuration/blahelement"> <property name="someattribute" value="@attribute" /> <property name="someinnertext" value="text()" /> <do> <echo>${someattribute}, ${someinnertext}</echo> </do> </xmlforeach> How does this sound? Matt. |