[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: re-ordering nodes

Subject: Re: re-ordering nodes
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 19 Dec 2001 23:55:39 +0000
Re:  re-ordering nodes
Hi Srini,

> "<o>" elements can nest other "<o>" elements as well, among other
> several tags. It seems like <xsl:copy> will copy the entire contents
> of the "<o>" element, including nested "<o>" tags. But, that is not
> the desired behavior.
>
> All "<o>" nodes should be re-ordering at the first level from the
> root. Other tags inside the "<o>" elements are to be preserved in
> the same parent node.

Perhaps you can make it clearer what you want the stylesheet to do. In
your sample, you had:

<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>

as the result from the source:

<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>

To write a stylesheet to give you that result, you need to articulate:

 - why the o elements are in a particular order - what governs that
   ordering?
 - why the comments have been added as they've been added - where do
   the numbers come from?

If you can write down the answers to those questions, chances are you
can write down the XSLT that will give you the structure that you
want. I don't know the answers to those questions, so I can't.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.