2
我想在基于Saxon的xslt转换中使用归类。源文件:XSL/Saxon归类/命令行
<root>
<entry name="B" />
<entry name="Aa" />
<entry name="Ä" />
<entry name="Az" />
</root>
和我的转型:
<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>
这工作几乎罚款,对氧输出是:
<root xmlns:saxon="http://saxon.sf.net/">
<sorted entry="Ä"/>
<sorted entry="Aa"/>
<sorted entry="Az"/>
<sorted entry="B"/>
</root>
(在A应该是第二项,但这是另一个问题,我猜)
但是,当我使用命令行,我得到一个错误:
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.
看起来好像撒克逊现在想用german
作为文件。它不存在。
问题是:如何在命令行上使用此样式表。
如果合适,我还会问如何得到两个“A”之间的“Ä”。条目,但我可以在另一个问题中提出这个问题。