This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: re-ordering nodes
- From: Jeni Tennison <jeni at jenitennison dot com>
- To: Srinivasan Guruswami - CSIS Fellow <srini at csis dot american dot edu>
- Cc: XSL-List at lists dot mulberrytech dot com
- Date: Wed, 19 Dec 2001 11:02:36 +0000
- Subject: Re: [xsl] re-ordering nodes
- Organization: Jeni Tennison Consulting Ltd
- References: <Pine.LNX.4.21.0112181254590.23250-100000@prax.unix.csis.american.edu>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello Srini,
> 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.
You can select all the o elements in your source document, at whatever
level, with:
//o
You can copy all of them with:
<xsl:copy-of select="//o" />
So possibly you want something like:
<xsl:template match="list">
<list>
<xsl:copy-of select="//o" />
</list>
</xsl:template>
If you wanted to change the content of the o elements, you should
apply templates to them instead:
<xsl:apply-templates select="//o" />
And have the template work out what to do with them.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list