是否可以在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
(但请选择一个更好的名称)。