ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29153] - macro with element parameter can't call another macro with element parm of same name
Date Mon, 24 May 2004 08:08:19 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29153>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29153

macro with element parameter can't call another macro with element parm of same name

peter.reilly@corvil.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID



------- Additional Comments From peter.reilly@corvil.com  2004-05-24 08:08 -------
The macro expands the contents of the nested element.
(It is a macro after all!)
Your original macro definitions are correct, however
you need to call <macro2/> as follows:

<macro2>
   <files>
      <files>
         <fileset dir="." includes="*.xml"/>
      </files>
   </files>
</macro2>

not nice but logical.
This can be seen if macro2 did not use the name "files" for the
nested element, by for example "files2":

<macro2>
   <files2>
      <files>
         <fileset dir="." includes="*.xml"/>
      </files>
   </files2>
</macro2>

This should be avoided when/if bug 25633 is implemented.
(In which case, one can to
<macrodef name="macro1">
  <element name="files"> implicit="yes">
  <sequential>
     <pathconvert property="foo" pathsep=":">
        <path>
          <files/>
        </path>
      </pathconvert>
      <echo message="${foo}"/>
   </sequential>
</macrodef>

<macro1>
   <fileset dir="." includes="*.xml"/>
</macro1>

I am marking this bug as INVALID, as it is by design, although
it is a bit counter intutative.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message