Apache camel 在Camel和Java中,Saxon以不同的方式处理多个可传递XSLT

Apache camel 在Camel和Java中,Saxon以不同的方式处理多个可传递XSLT,apache-camel,xslt-2.0,saxon,Apache Camel,Xslt 2.0,Saxon,在JUnit测试中使用Saxon 9.5.1-4作为XSLT转换引擎,我看到以下警告: 警告:样式表模块文件:/C:/svn/prime/code/trunk/xslt/target/main/classes/xsl/common/to common result。xsl包含或导入多次。这是允许的,但可能会导致错误或意外行为 但是,当它在ApacheCamel 2.13.1下运行时,它会在发出警告后失败 15:11:29,714 WARN [org.apache.camel.builder.x

在JUnit测试中使用Saxon 9.5.1-4作为XSLT转换引擎,我看到以下警告:

警告:样式表模块
文件:/C:/svn/prime/code/trunk/xslt/target/main/classes/xsl/common/to common result。xsl
包含或导入多次。这是允许的,但可能会导致错误或意外行为

但是,当它在ApacheCamel 2.13.1下运行时,它会在发出警告后失败

15:11:29,714 WARN  [org.apache.camel.builder.xml.XsltErrorListener] (ServerService Thread Pool -- 90) Stylesheet module ../common/to-common-result.xsl is included or imported more than once. This is permitted, but may lead to errors or unexpected behavior
15:11:29,714 ERROR [org.apache.camel.builder.xml.XsltErrorListener] (ServerService Thread Pool -- 90) A stylesheet cannot import itself; SystemID: ; Line#: 11; Column#: 53: net.sf.saxon.trans.XPathException: A stylesheet cannot import itself
    at net.sf.saxon.style.StyleElement.compileError(StyleElement.java:1961) [Saxon-HE-9.5.1-4.jar:]
    at net.sf.saxon.style.XSLGeneralIncorporate.checkForRecursion(XSLGeneralIncorporate.java:234) [Saxon-HE-9.5.1-4.jar:]
    at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:123) [Saxon-HE-9.5.1-4.jar:]
    at net.sf.saxon.style.StylesheetModule.spliceIncludes(StylesheetModule.java:143) [Saxon-HE-9.5.1-4.jar:]
    at net.sf.saxon.style.XSLGeneralIncorporate.getIncludedStylesheet(XSLGeneralIncorporate.java:210) [Saxon-HE-9.5.1-4.jar:]
什么可以解释这种差异

导入结构如下所示:

A imports B, C;
B imports D, E, F;
C imports G;
F imports G;

G是公共结果的

15:11:29,714 ERROR [org.apache.camel.builder.xml.XsltErrorListener] (ServerService Thread Pool -- 90) A stylesheet cannot import itself; SystemID: ; Line#: 11; Column#: 53: net.sf.saxon.trans.XPathException: A stylesheet cannot import itself
SystemId为空。这表明样式表在某种程度上是在不知道每个模块的正确URI的情况下编译的,这意味着Saxon可能认为模块正在导入自己,因为两者都有一个空白URI


因此,您需要了解Apache Camel是如何调用转换的,以及为什么它没有为Saxon提供正确的样式表基URI。

是样式表无法导入自身的
;SystemID:
真正的错误消息?或者它是在
SystemID
之后命名文件的吗?
Line#11
看起来怎么样?