GNOME Bugzilla – Bug 143383
xsl:sort attributes 'lang' and 'case-order' ignored
Last modified: 2009-08-15 18:40:50 UTC
(testing done with libxslt-1.1.6 / libxml2-2.6.9 under W2K) lang="xx" and case-order="lower-first" /case-order="upper-first" don't show any effect. sorting seems to be done by character code position only. example: with lang="de" and case-order="lower-first" xsl:sort should sort a A ä Ä b B ... z Z but yields A B ... Z a b ... z Ä ä this, I'm very sorry to say, makes libxslt plain unusable in any non-english context. any plans for fixing this in upcoming versions? http://www.rostra.dk/alphabet/alpha_en.htm gives a good overview about culturally expected sort results, gory details in http://www.unicode.org/unicode/reports/tr10/ TIA, andreas
Could you attach a minimal test case? Thanks.
Created attachment 28185 [details] xsl:sort test bed (xml, dtd, xsl)
Well "plain unusable" for you, lots of people have been using it without. If you look at the amount of data/code needed to implement this, this is huge. We are not tempted to add this, if you have a patch and can make it in a reasonable size why not, otherwise it's unlikely. ICU is the only software I could fount which might implement those orderings and it's itself 2 times bigger than both libxml2 and libxslt together :-( On the other hand there is an API to plug new sort routines precisely because of that limitation and an example to plug the ICU library for this. See the discussion thread ending in: http://mail.gnome.org/archives/xslt/2002-November/msg00093.html So the status quo is a won't fix until we find a way to plug it in the code base without generating a huge code base increase or a dependancy on such a huge code base. Daniel
I've hit this problem as well. I have a large list of items in XML that I'm generating HTML for and the sort order comes out all wrong. All of the items with lower case starting letters end up at the end of the list. It means that I can't use xsltproc, which is an enormous pity.
Created attachment 29288 [details] Test data This is a very simple test case. Unless this data can be sorted properly xsltproc cannot be said to comply with the XSLT standard.
It should be clear at this point that what is needed is not a test case but a reasonably sized implementation of said feature, and so far there is no solution in sight. You can use the ICU library if you want I do not want to make xsltproc depend on it ! Daniel