Re: [xsl] Problem with xsl:sort and German

Subject: Re: [xsl] Problem with xsl:sort and German
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Mon, 10 Aug 2009 18:58:13 +0200
jjett2@xxxxxxxxxxxx wrote:

I'm using xsl 1.0 and the Saxon-B 9.1.0.6 transformer (rather than
the libxslt). I believe I have told the xslt to sort using German
(i.e. lang='de'). My sort statement looks like this:

<xsl:sort select="translate(normalize-space((
analytic/author/text()[normalize-space()],
monogr/author/text()[normalize-space()],
analytic/title/text()[normalize-space()],
monogr/editor/text()[normalize-space()],
monogr/title/text()[normalize-space()],
monogr/meeting/text()[normalize-space()] )[1]),
'adbcdefghijklmnovpqrs_tu|vwxyz.-_,()[]/:;&quot;?''',
'ADBCDEFGHIJKLMNOVPQRS_TU\VWXYZ')" lang="de" order="ascending"/>

The Saxon documentation
http://www.saxonica.com/documentation/xsl-elements/sort.html
says:
"The value of the lang attribute can be an ISO language code such as "en" (English) or "de" (German). It determines the algorithm used for alphabetic collating. The default is based on the Java system locale. The only collating sequence supplied with the Saxon product is "en" (English), but other values may be supported by writing a user-defined comparison class. If no comparison class is found for the specified language, a default algorithm is used which simply sorts according to Unicode binary character codes. "


So I don't think using lang="de" suffices. http://www.ibm.com/developerworks/library/x-xsltsorting/ might show what to do but I haven't checked whether the solution there works with Saxon 9.1. You might want to raise the problem on the Saxon help list if you can't get it to work.


--


	Martin Honnen
	http://msmvps.com/blogs/martin_honnen/

Current Thread