This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

re-ordering nodes



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]