This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
De-flattening an XML tree
- From: Benjamin Johnston <s355171 at student dot uq dot edu dot au>
- To: <XSL-List at lists dot mulberrytech dot com>
- Cc: Benjamin Johnston <s355171 at student dot uq dot edu dot au>
- Date: Wed, 9 Jan 2002 11:24:33 +1000 (GMT+1000)
- Subject: [xsl] De-flattening an XML tree
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
I'm kind of stuck on ideas for how I might de-flatten a tree. It seems
that I can't get the position of the next sibling with some property and I
end up going around in circles with checking siblings because filter
predicates seem to only work with one node at a time.
If I've got something like;
<recordset>
<record/>
<data/>
<data/>
<record/>
<data/>
<record/>
<data/>
<data/>
<data/>
</recordset>
ie. we've got a record tag, followed by it's "children".
Is there any way of transforming this to:
<recordset>
<record>
<data/>
<data/>
</record>
<record>
<data/>
</record>
<record>
<data/>
<data/>
<data/>
</record>
</recordset>
Any suggestions, ideas or strategies?
Thanks a lot!
-Benjamin Johnston
s355171@student.uq.edu.au
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list