Special characters sort incorrectly, Windows only
Posted: Sun Jan 17, 2010 5:26 pm
Special characters, in my case Norwegian/Danish "æøå" sort with "eoa" under Windows XP and Vista, while they sort correctly under Mac OS 10.5 and 10.6, all oXygen 11.1. and XSLT 2.0, Saxon. See examples below. Suggestions are most welcome.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="sorttest.xsl"?>
<test>
<item>ædabæda - this should be the third item from the end</item>
<item>å, du store min - this should be the last item</item>
<item>zebra</item>
<item>øl means beer and should sort second to last </item>
<item>foxtrot</item>
<item>baker</item>
<item>able</item>
</test>
<xsl:stylesheet version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"></xsl:output>
<xsl:template match="/">
<html>
<head>
<title>test</title>
</head>
<body>
<xsl:for-each select="test/item">
<xsl:sort lang="no" order="ascending" select="."></xsl:sort>
<p>
<xsl:value-of select="."></xsl:value-of>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="sorttest.xsl"?>
<test>
<item>ædabæda - this should be the third item from the end</item>
<item>å, du store min - this should be the last item</item>
<item>zebra</item>
<item>øl means beer and should sort second to last </item>
<item>foxtrot</item>
<item>baker</item>
<item>able</item>
</test>
<xsl:stylesheet version="2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"></xsl:output>
<xsl:template match="/">
<html>
<head>
<title>test</title>
</head>
<body>
<xsl:for-each select="test/item">
<xsl:sort lang="no" order="ascending" select="."></xsl:sort>
<p>
<xsl:value-of select="."></xsl:value-of>
</p>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>