How to print the value of the <element> specified into a macrodef?

109 Views Asked by At

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.

0

There are 0 best solutions below