在 Orbeon 中使用特定版本的 Saxon

Using a specific version of Saxon in Orbeon

是否可以在 Orbeon 中使用特定版本的 Saxon,即绕过使用内置版本并使用 Saxon-HE 或 Saxon-EE? 我该怎么做?

2010 年的一些旧论坛帖子表明这是可能的,但其中的链接现已失效。

仅对于 XSLT 转换,这是可能的,尽管目前还没有真正记录或鼓励这样做。

WEB-INF/resources/config/processors-local.xml中设置:

<processors xmlns:oxf="http://www.orbeon.com/oxf/processors">

    <processor name="oxf:my-saxon">
        <instantiation name="oxf:generic-xslt-2.0">
            <input name="transformer">
                <config>
                    <class>net.sf.saxon.TransformerFactoryImpl</class>
                </config>
            </input>
            <input name="attributes">
                <attributes xmlns:xs="http://www.w3.org/2001/XMLSchema">
                    <!-- By default, prevent usage of external functions for security purposes -->
                    <attribute as="xs:boolean" name="http://saxon.sf.net/feature/allow-external-functions" value="false"/>
                    <!--
                    <attribute as="xs:boolean" name="http://saxon.sf.net/feature/trace-external-functions" value="false"/>
                    <attribute as="xs:boolean" name="http://saxon.sf.net/feature/timing" value="false"/>
                    <attribute as="xs:integer" name="http://saxon.sf.net/feature/treeModel" value="STANDARD_TREE = 0 / TINY_TREE = 1"/>
                    <attribute as="xs:boolean" name="http://saxon.sf.net/feature/linenumbering" value="false"/>
                    <attribute as="xs:integer" name="http://saxon.sf.net/feature/recoveryPolicy" value="RECOVER_SILENTLY = 0 / RECOVER_WITH_WARNINGS = 1 / DO_NOT_RECOVER = 2"/>
                    <attribute as="xs:boolean" name="http://saxon.sf.net/feature/validation" value="false"/>
                    <attribute as="xs:boolean" name="http://saxon.sf.net/feature/schema-validation" value="false"/>
                    <attribute as="xs:boolean" name="http://saxon.sf.net/feature/validation-warnings" value="false"/>
                    -->
                </attributes>
            </input>
        </instantiation>
    </processor>

</processors>

当然,还要将您的 Saxon JAR 放入 WEB-INF/lib

然后,在使用处理器时,你应该使用oxf:my-saxon(但要取一个更好的名字)。