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.



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to