You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by mirko <mi...@o2.pl> on 2004/06/05 01:07:32 UTC
Re[2]: JXTemplate and hierarchical structure
W Twoim liście datowanym 4 czerwca 2004 (18:38:00) można przeczytać:
UC> mirko wrote:
>> Is there a way to get recursive processing in JXTemplate? I need to
>> make hierarchical structure in the document. Or maybe I should flatten
>> the structure in my logic beans and then process it with simple
>> 'for each' statement.
UC> You can use a recursive macro:
UC> <jx:macro name="subtree">
UC> <jx:parameter name="classes" optional="false"/>
UC> <jx:forEach select="${classes}">
UC> <class id="#{id}">
UC> <name>#{name}</name>
UC> <subtree classes="#{children}"/>
UC> </class>
UC> </jx:forEach>
UC> </jx:macro>
UC> <jx:forEach select="#{classes}">
UC> <class id="#{id}">
UC> <name>#{name}</name>
UC> <subtree classes="#{children}"/>
UC> </class>
UC> </jx:forEach>
Thanks! It's what I needed.
Regards,
mirko
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org