使用 Saxon XSLT 处理器避免换行

Avoiding line breaks with Saxon XSLT processor

正在当前 saxon9he.jar 中测试 xsl:output 并尝试使用以下调用:

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

这导致 "Exception in thread "主要" net.sf.saxon.trans.LicenseException: 请求的功能(自定义序列化 {http://saxon.sf.net/}line-length)需要 Saxon-PE"

同时在另一个样式表中,以下内容似乎有效:

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

升级到付费 PE 版本不是一种选择,因为这项工作是必须可重复的开源标准开发项目的一部分。也不想将样式表(和调用)从 xsl:output 重构为 xsl:result-document.

我希望这两个 xsl 元素可以实现一致的实现支持。

saxon:line 长度的参考文献是 http://www.saxonica.com/documentation9.5/extensions/output-extras/line-length.htmlhttp://www.saxonica.com/documentation/index.html#!changes/serialization/9.2-9.3

一般规则是所有 Saxon 扩展都需要 Saxon-PE。我认为 Saxon-HE 对这两种情况的正确操作应该是输出警告并忽略请求:我会检查是否发生了这种情况。

我们很高兴提供与开源社区高度一致的 XSLT 处理器;我们能够做到这一点要归功于为商业版本付费的人们。如果这有时意味着开源用户不能总是拥有他们想要的所有功能,我很抱歉,但如果没有这种商业模式,开源用户将一无所有。