RE: [xsl] Multi-level sorting.

Subject: RE: [xsl] Multi-level sorting.
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 3 Jun 2003 10:31:31 +0300
Hi,


> I have 3 separate nodes (topnav, bottomnav, & staticnav) 
> within my root
> node.  When all is said and done I want the information to be 
> displayed in
> alphabetical order. I want it sorted by the "name" attribute 
> regardless of
> the level of the node in the tree.  The desirable output would look
> something like this:
> 
> aaa
> bbb
> ccc
> ddd
> eee
> fff
> ...
> ...
> www
> 
> Any help would be appreciated.  My email is 

  <xsl:output method="text"/>
  <xsl:template match="root">
    <xsl:for-each select="descendant::*/@name">
      <xsl:sort select="."/>
      <xsl:value-of select="."/>
      <xsl:text>&#xA;</xsl:text>
    </xsl:for-each>
  </xsl:template>

Cheers,

Jarno - Hocico: Final Resource

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


Current Thread