|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] recursions?
I have an XML source like this (simplified):
...
<parent>
<field>
<group>
<field/>
<group>
<field/>
</group>
<field/>
...
</group>
<field/>
...
</parent>
...
where the order of field and group elements is variable and the nesting
of groups can be infinite. The order of appearance in the tree is very
important. Now I'm using a for-each descendant::* construct from the
parent node to process all elements. This works fine as long as I just
want a "flat" output. But I want a hierarchical output, somewhat like
this:
FIELD
blabla, blabla
GROUP
blabla
FIELD
blabla, blabla
FIELD
....
GROUP
...
FIELD
...
FIELD
...
Since the template doesn't know in which level of the hierarchy it is,
it can't indent the output correctly.
How would you do this? Is there a way to recursively traverse the
nodes? So when I'm at a group node, it would call a template to check
again for group and field and branch off from there recursively?
Thanks for any suggestions
Dennis
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








