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: re-ordering nodes


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


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