I have an XSL stylesheet which formats a date in a given locale. When I run the stylesheet from Oxygen, the output is in German as expected. When I use the command line for saxon9he or xproc, the output is in english. I'd like to have it in german instead.
Source (any source file will do) source.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<root/>
XSL file transformation.xsl
:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<foo>
<xsl:value-of select="format-date(current-date(),'[FNn]','de',(),())"/>
</foo>
</xsl:template>
</xsl:stylesheet>
and the XProc file (showdate.xpl
):
<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
<p:input port="source" sequence="false">
<p:document href="source.xml"/>
</p:input>
<p:output port="result" sequence="true">
<p:empty/>
</p:output>
<p:xslt>
<p:input port="stylesheet">
<p:document href="transformation.xsl"/>
</p:input>
<p:input port="parameters">
<p:empty/>
</p:input>
</p:xslt>
<p:store href="out.xml"/>
</p:declare-step>
This is how I run the xproc file from my Mac Terminal:
export CLASSPATH=...../lib/calabash.jar:....../lib/saxon9he.jar
java com.xmlcalabash.drivers.Main showdate.xpl
And the result is this:
<?xml version="1.0" encoding="UTF-8"?>
<foo>[Language: en]Thursday</foo>
whereas I'd like to have
<?xml version="1.0" encoding="UTF-8"?>
<foo>Donnerstag</foo>
How can I get the result I'd like to have with xproc / calabash?
@topskip is correct. Oxygen uses Saxon EE which comes with localization support for a number of languages (the same goes for Saxon PE).
Saxon HE (which Calabash uses by default) does not come with out-of-the-box localization support, hence the English output. Having said that, however, there is apparently a way to configure localization in Saxon HE as well - see Saxon documentation.