0

Having a macrodef like

<macrodef name = "printSomething">
    <attribute name = "attribute1" />
    <element name = "args" optional="true"/>
    <sequential>
     <echo message = "attr is: @{attribute1} and the arguments are:"><args/></echo>
    </sequential>
</macrodef>

which will be called like the example below

<printSomething attribute1="thisIsAttribute">
    <args>
        <arg value="element1"/>
        <arg value="element2"/>
    </args>
</printSomething>

How can I print elements element1 and element2 like below?

attr is: thisIsAttribute and the arguments are: element1 element2

This aproach doesn't help me. I DO NOT want to save the content of the xml into a property and print the property.

Nelly Junior
  • 556
  • 2
  • 10
  • 30
  • Please check if you can use `xmltask` - https://stackoverflow.com/questions/2344295/how-to-parse-a-xml-by-ant – Rao Jun 20 '17 at 14:23
  • @Rao: It doesn't help me. I don't need to extract the elements each time I call . I need to put an echo into the macrodef so as to print the arguments passed when I call that printSomething task. – Nelly Junior Jun 21 '17 at 13:21

0 Answers0