【发布时间】:2020-04-27 18:15:32
【问题描述】:
使用 Saxon9he,我想将输入文件的目录传递给我的 XSLT 样式表。我在样式表中定义了参数:
<xsl:param name="publishing.folder" />
在命令行上:
+publishing.folder="%~dp1\"
+ 参数为空。
没有+,
publishing.folder="%~dp1\"
我得到:Error in xsl:result-document/@href Resolved URL is malformed: unknown protocol: d
d 可能是驱动器号,即输入文件所在的位置。
这是导致错误的带有@href 的代码:
<xsl:template match="/">
<xsl:call-template name="write-dataset-file">
<xsl:with-param name="filename" select="concat($publishing.folder,'-dataset.xml')"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="write-dataset-file">
<xsl:param name="filename"/>
<xsl:result-document href="{$filename}" omit-xml-declaration="false" method="xml" indent="yes">
<Dataset>
</Dataset>
</xsl:result-document>
</xsl:template>
xalan 接受命令行参数-PARAM publishing.folder "%~dp1\",但我宁愿不回到 XSLT 1.0
【问题讨论】:
标签: xml command-line xslt-2.0 saxon