|
Subject: [xsl] recursions? From: Dennis Luemkemann <dll@xxxxxxxxxxxxxx> Date: Wed, 20 Jun 2001 12:47:39 -0400 |
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
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] include, document and namespa, Ruben Inoto | Thread | Re: [xsl] recursions?, Jeni Tennison |
| RE: [xsl] Inserting spaces in my FO, Michael Kay | Date | [xsl] Background color change not w, Betty . Risher |
| Month |