velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lloyd <subscr...@twilight-systems.com>
Subject Re: Recursion
Date Wed, 07 Aug 2002 23:12:18 GMT
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>


Mime
View raw message