Special characters sort incorrectly, Windows only

Here should go questions about transforming XML with XSLT and FOP.
KjetilHauge
Posts: 2
Joined: Sun Jan 17, 2010 5:15 pm

Special characters sort incorrectly, Windows only

Post by KjetilHauge »

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>
adrian
Posts: 2883
Joined: Tue May 17, 2005 4:01 pm

Re: Special characters sort incorrectly, Windows only

Post by adrian »

Hi,

Are you sure you are using the same transformer in the transformation scenario on both platforms?

The Saxon 6.5.5 transformer (the default transformer for a new scenario) does not sort correctly in this case so you should change it to Saxon-EE.

You can find the transformer in Configure Transformation Scenario(Document -> Transformation), Edit the associated scenario and check the Transformer combo.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
KjetilHauge
Posts: 2
Joined: Sun Jan 17, 2010 5:15 pm

Re: Special characters sort incorrectly, Windows only

Post by KjetilHauge »

That did the trick, thank you very much.
Post Reply