1

特定のロケールで日付をフォーマットする XSL スタイルシートがあります。Oxygen からスタイルシートを実行すると、出力は期待どおりドイツ語になります。saxon9he または xproc のコマンド ラインを使用すると、出力が英語になります。代わりにドイツ語でお願いします。

ソース (任意のソース ファイルでかまいません) source.xml:

<?xml version="1.0" encoding="UTF-8"?>
<root/>

XSL ファイル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> 

および XProc ファイル ( 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>

これは、Mac ターミナルから xproc ファイルを実行する方法です。

export CLASSPATH=...../lib/calabash.jar:....../lib/saxon9he.jar
java com.xmlcalabash.drivers.Main showdate.xpl

結果は次のとおりです。

<?xml version="1.0" encoding="UTF-8"?>
<foo>[Language: en]Thursday</foo>

一方、私は持っていたい

<?xml version="1.0" encoding="UTF-8"?>
<foo>Donnerstag</foo>

xproc / calabash で希望する結果を得るにはどうすればよいですか?

4

1 に答える 1