xsl:output 媒体类型与命令行
xsl:output media-type with the command-line
当我在 XSLT 文件中使用以下内容时,Saxon 输出扩展名为 .htm 的文件
<xsl:output method="html"
version="5.0"
doctype-system="about:legacy-compat"
encoding="UTF-8"
indent="yes"
media-type="text/html"/>
然而,当我 运行 通过 CLI 进行转换并使用 !media-type=text/html 传递输出参数时,Saxon 输出具有 xml 扩展名的文件
下面是我使用的命令,我是不是做错了什么?
java -jar /Users/Stephane/XSLT_DEV/saxon/saxon9he.jar -s:/Users/Stephane/XSLT_DEV/S1000D/xml/ -o:/Users/Stephane/XSLT_DEV/S1000D/html/ -xsl:$file cssPath='../xslt/assets' imagesPath='graphics/' !method='html' !version='5.0' !encoding='UTF-8' !indent='yes' !media-type='text/html';
输出文件名的自动生成仅在一种特定情况下发生:您使用命令行处理输入文件目录以生成输出文件目录。它根据 xsl:output/@media-type
的值做出决定,忽略命令行上提供的 !media-type 的任何值。没有特别的原因,但这就是它的作用。该值将为“.xml”、“.html”或“.txt”。
在所有其他情况下,输出文件名就是您选择的名称。
当我在 XSLT 文件中使用以下内容时,Saxon 输出扩展名为 .htm 的文件
<xsl:output method="html"
version="5.0"
doctype-system="about:legacy-compat"
encoding="UTF-8"
indent="yes"
media-type="text/html"/>
然而,当我 运行 通过 CLI 进行转换并使用 !media-type=text/html 传递输出参数时,Saxon 输出具有 xml 扩展名的文件
下面是我使用的命令,我是不是做错了什么?
java -jar /Users/Stephane/XSLT_DEV/saxon/saxon9he.jar -s:/Users/Stephane/XSLT_DEV/S1000D/xml/ -o:/Users/Stephane/XSLT_DEV/S1000D/html/ -xsl:$file cssPath='../xslt/assets' imagesPath='graphics/' !method='html' !version='5.0' !encoding='UTF-8' !indent='yes' !media-type='text/html';
输出文件名的自动生成仅在一种特定情况下发生:您使用命令行处理输入文件目录以生成输出文件目录。它根据 xsl:output/@media-type
的值做出决定,忽略命令行上提供的 !media-type 的任何值。没有特别的原因,但这就是它的作用。该值将为“.xml”、“.html”或“.txt”。
在所有其他情况下,输出文件名就是您选择的名称。