This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
XSLT for unflattening a tree?
- To: xsl-list at mulberrytech dot com
- Subject: XSLT for unflattening a tree?
- From: Stuart Hungerford <stuart dot hungerford at webone dot com dot au>
- Date: Fri, 07 Apr 2000 09:48:23 +1000
- Organization: Zveno
- References: <200004061947.PAA26134@mulberrytech.com>
- Reply-To: xsl-list at mulberrytech dot com
Hi all,
I've been working with a series of XML documents that effectively represent
"flattened" trees. Instead of using nested elements for each level of the tree,
they use empty header elements that indicate the tree level:
<h1/>
<h2/>
<content .../>
<h3/>
<content .../>
<h3/>
<content .../>
<h2/>
...
<h1/>
...
My question is what would be involved in using XSLT to convert that
structure to a nested element structure:
<h1>
<h2>
<content .../>
<h3>
<content .../>
</h3>
<h3>
...
</h3>
...
</h2>
</h1>
In one sense I'd like to maintain a stack of levels, but that's not necessarily
the XSLT "way". Am I barking up the wrong tree to do this kind of thing
in XSLT?
Cheers,
Stu
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list