This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: sort and collating sequence
- From: "W. Eliot Kimber" <eliot at isogen dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Mon, 25 Feb 2002 22:30:00 -0600
- Subject: Re: [xsl] sort and collating sequence
- Organization: DataChannel, Inc
- References: <Pine.LNX.4.33.0202251331530.11107-100000@eagle.datapower.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Jeff Kenton wrote:
>
> xsl:sort gives "dictionary order", so what you see is according to
> specification. As programmers we are used to sorting by ASCII code, but
> this is intentionally different.
In the Java domain (e.g., Saxon, Xalon) you can use Java's built-in
Collator objects to customize sorting in any way you need. For example,
the ICU4J package from IBM provides a number of custom locale-specific
collators for that are not included in Java (at least not in Java 1.3,
they may be in 1.4, I don't know). The syntax for customizing Java
collators is pretty straight forward and it's pretty easy to get the
collation rules from a built-in collator and tweak it. I've had to do
this in order to support back-of-the-book indexing for some challenging
languages, such as Traditional and Simplified Chinese (although the
ICU4J package made my job much easier).
Cheers,
Eliot
--
W. Eliot Kimber, eliot@isogen.com
Consultant, ISOGEN International
1016 La Posada Dr., Suite 240
Austin, TX 78752 Phone: 512.656.4139
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list