Avoiding line breaks with Saxon XSLT processor

时间:2017-04-10 00:01:36

标签: saxon

Am testing xsl:output in current saxon9he.jar and trying to use the following invocation:

    <xsl:output encoding="UTF-8" media-type="text/plain"
        indent="yes" method="text" saxon:line-length="1000"/>

which results in "Exception in thread "main" net.sf.saxon.trans.LicenseException: Requested feature (custom serialization {http://saxon.sf.net/}line-length) requires Saxon-PE"

Meanwhile in another stylesheet, the following seems to work:

    <xsl:result-document href="{$sourceFilePath}" method="html" omit-xml-declaration="yes"
         encoding="UTF-8" indent="yes" saxon:line-length="120">

Upgrading to paid PE version is not an option, since this work is part of an open-source standards-development project which must be repeatable. Also didn't want to refactor stylesheets (and invocations) from xsl:output to xsl:result-document.

Am hoping that consistent implementation support might be possible for both xsl elements.

References for saxon:line-length are http://www.saxonica.com/documentation9.5/extensions/output-extras/line-length.html and http://www.saxonica.com/documentation/index.html#!changes/serialization/9.2-9.3

1 个答案:

答案 0 :(得分:2)

一般规则是所有撒克逊扩展都需要Saxon-PE。我认为Saxon-HE对这两者的正确行动应该是输出警告并忽略请求:我会检查是否发生了什么。

我们很高兴为开源社区提供高度一致的XSLT处理器;我们能够做到这一点的事实是感谢支付商业版本的人。对不起,如果这有时意味着开源用户无法始终拥有他们想要的所有功能,但没有这种商业模式,开源用户就什么都没有。