Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1 Add something like the <for> task

closed
nobody
None
5
2006-10-27
2005-04-29
Maarten Coene
No

Hi,

the <call> section of <xmltask> is like the <foreach>
task of ant-contrib. The 'disadvantage' of this approach is
that you'll have to define a new target, which does most
of the times something very simple.

Adding something similar like the <for> task of ant-
contrib would make the usage of <xmltask> a lot easier
when iterating over nodesets.

regards,
Maarten

Discussion

  • Brian Agnew
    Brian Agnew
    2005-05-23

    Logged In: YES
    user_id=521055

    Interesting idea. I'll take a look at this when I get a chance.

     
  • Maarten Coene
    Maarten Coene
    2006-05-12

    Patch for Call.java

     
    Attachments
  • Maarten Coene
    Maarten Coene
    2006-05-12

    New file

     
  • Maarten Coene
    Maarten Coene
    2006-05-12

    Logged In: YES
    user_id=178745

    Hi,

    I've uploaded a patch which allows you to use <sequential>
    subelements in the <call> element. For instance:

    <xmltask source="test.xml">
    <call path="/modules/module">
    <param name="modName" path="@name"/>
    <param name="modOwner" path="@owner" default="n/a"/>
    <sequential>
    <echo>Module Name: @{modName}</echo>
    <echo>Module Owner: @{modOwner}</echo>
    </sequential>
    </call>
    </xmltask>

    The body of the <sequential> element is executed for each
    node of the evaluated xpath.

    regards,
    Maarten

     
  • Maarten Coene
    Maarten Coene
    2006-10-27

    Logged In: YES
    user_id=178745

    Hi,
    you can close this RFE, it has been added in version 1.12 :-)

    regards,
    Maarten

     
  • Maarten Coene
    Maarten Coene
    2006-10-27

    • status: open --> closed