This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
re-ordering nodes
- From: Srinivasan Guruswami - CSIS Fellow <srini at csis dot american dot edu>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Tue, 18 Dec 2001 13:06:29 -0500 (EST)
- Subject: [xsl] re-ordering nodes
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello XSL Experts:
I am relatively new to XSL and would like to know how the
following transformation can be accomplished through XSL. I have tried
several sample XSL patterns and I would really appreciate if someone can
throw some light.
Input:
-------->
<?xml version="1.0" encoding="UTF-8" standalone = "no"?>
<list>
<o>
<a/>
<b/>
<a>
<o> 1 </o>
<o> 2 </o>
</a>
<b>
<o> 3 </o>
<o>
<a value="1"/>
<b value="2"/>
<o> 4 </o>
</o>
</b>
</o>
</list>
Output
---------->
<?xml version="1.0" encoding="UTF-8" standalone = "no"?>
<list>
<o> 1 </o>
<o> 2 </o>
<o> 3 </o>
<o> 4 </o>
<o>
<a value="1">
<b value="2">
</o>
<o>
<a/>
<b/>
<a> <!-- for 1, 2 --> </a>
<b> <!-- for 3, 4 --> </b>
</o>
</list>
---- End of listing ---->
The goal is to re-group all the <o> nodes at the first level from the root
node. The relative order is not so much of a concern at this time.
Thanks,
-Srini
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list