|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








