velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Esterline <Ad...@cait.wustl.edu>
Subject RE: Recursion
Date Thu, 08 Aug 2002 12:20:30 GMT
No.   That still did not work.

Adam

-----Original Message-----
From: lloyd [mailto:subscr001@twilight-systems.com]
Sent: Wednesday, August 07, 2002 6:12 PM
To: Velocity Users List
Subject: Re: Recursion


Adam Esterline wrote:
> I have seen several posts about this issue, but I still don't understand.
> Here is my example, could someone please explain why this does not work.
> 
> 
> ## Macro for creating the outline XML
> #macro( processNode $node )
> <item>
>    <text>$node.text</text>
>    #foreach( $child in $node.children )
>       #processNode( $child )
>    #end
> </item>
> #end


Wild guess:

Have you tried getting a reference to children first:

#(set $childNodes = $node.children )
#foreach( $child in $childNodes )
...etc

?


--
To unsubscribe, e-mail:
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:velocity-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message