I want to use collations in the Saxon based xslt transformation. The source file:
<root>
<entry name="B" />
<entry name="Aa" />
<entry name="Ä" />
<entry name="Az" />
</root>
and my transformation:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/">
<xsl:output indent="yes"/>
<saxon:collation name="german" lang="de-DE"/>
<xsl:template match="root">
<root>
<xsl:for-each select="entry">
<xsl:sort select="@name" collation="german"/>
<sorted entry="{@name}"/>
</xsl:for-each>
</root>
</xsl:template>
</xsl:stylesheet>
This works almost fine in Oxygen, the output is:
<root xmlns:saxon="http://saxon.sf.net/">
<sorted entry="Ä"/>
<sorted entry="Aa"/>
<sorted entry="Az"/>
<sorted entry="B"/>
</root>
(The Ä should be the second entry, but that's another question, I guess)
But when I use the command line, I get an error:
java -jar saxon9he.jar -s:source.xml -o:out.xml -xsl:transformation.xsl
XTDE1035: Collation file:/Users/<mypath>/german has not been defined
Failed to compile stylesheet. 1 error detected.
It looks as if saxon now wants to use german as a file. It does not exist.
The question is: how do I use this stylesheet on the command line.
If it is appropriate, I'd also ask how to get the "Ä" sorted between the two "A." entries, but I can ask this in another question.