RE: [xsl] Sorting Index alphabetically

Subject: RE: [xsl] Sorting Index alphabetically
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 24 Nov 2005 13:52:06 -0000
Look up xsl:sort.

However, the spec doesn't define the collating sequences that are available,
and these may vary by product. Most products will probably sort "Acdes"
after "abc" by default (just as a dictionary would). In XSLT 2.0 you can
explicitly say
collation="http://www.w3.org/2005/xpath-functions/collation/codepoint"; in
which case characters are sorted according to their Unicode codepoints. This
seems to be what you are looking for.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: shailesh [mailto:shailesh@xxxxxxxxxxxx] 
> Sent: 24 November 2005 13:39
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Sorting Index alphabetically
> 
> Hi All,
> 
> How do I sort index alphabetically using xsl.
> 
> I have xml file like:
> 
> <Keyword>abc</keyword>
> <Keyword>abcd</keyword>
> <Keyword>abcde</keyword>
> <Keyword>abcef</keyword>
> <Keyword>bcdes</keyword>
> <Keyword>Acdex</keyword>
> <Keyword>Bcdes</keyword>
> <Keyword>ccdes</keyword>
> <Keyword>Ccdes</keyword>
> 
> I have to sort this as 
> 
> <h2>A</h2>
> Acdes
> Acdex
> abc
> abcd
> 
> <h2>B</h2>
> Bcdes
> Bcdes
> 
> Thanks,
> Shailesh

Current Thread