Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2006, 07:00 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default sorting elements with composed characters

i nid to sort an xml with elements that has composed characters.
does the xsl:sort interpret an a-acute and a simple a the same? thanks.

 
Old February 8th, 2006, 09:08 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Collating sequences for xsl:sort depend on the XSLT processor you are using, they aren't defined in the language spec.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 9th, 2006, 01:29 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i see. sir, i use your saxon processor. so does saxon, interpret it that way? thanks.

 
Old February 9th, 2006, 04:30 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Saxon 6.x implements collation for xsl:sort using the Java collation rules for your locale, or for the selected language if you specify the lang attribute of xsl:sort. Saxon 8.x offers much more detailed control over collations, which is described at http://www.saxonica.com/documentatio...collation.html

I'm afraid it's rather daunting technically - there's a lot of background to become familiar with, and the end result is that it can still be quite difficult to get exactly the collation you want, especially when it comes to handling of spaces and punctuation. But as far as accented characters are concerned, the collations for most European languages will sort first by the base letters, then by case, and then by accents, which means for example that Kuchen will sort after Küche - the umlaut is taken into account only if everything else in the word is identical. There are exceptions for some languages where certain "accented" letters are considered to be first-class letters in their own right, for example this applies to ø in Scandinavian languages.

The simplest way to find out what the software does is to experiment.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 12th, 2006, 11:12 PM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i just replaced the combining diacritics with ''. but i found out that xsl:sort ignores the space. for example, when i sort "ABBASA" and "ABBAS .b ABI", the xsl:sort outputs ABBASA first when the right sorting is ABBAS .b ABI then followed by ABBASA. is there a solution to this? thanks.

 
Old February 13th, 2006, 01:22 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i'm sorry if i did not see the space issue you wrote, so what else can i do with it? thanks.

 
Old February 13th, 2006, 04:29 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Which version of Saxon are you using?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting Elements scopley XSLT 4 November 7th, 2007 11:14 AM
sorting nested elements again stekker XSLT 1 June 5th, 2006 03:38 AM
sorting nested elements stekker XSLT 5 June 5th, 2006 01:19 AM
Datagrid sorting by non alphabetical sorting? LLAndy VS.NET 2002/2003 1 July 15th, 2004 01:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.