54.8. 使用 xsl:include
Camel 提供自己的 URIResolver 实施。这允许 Camel 从 classpath 中加载包含的文件。
例如,以下代码中的 include 文件将相对于起始端点定位。
<xsl:include href="staff_template.xsl"/>
<xsl:include href="staff_template.xsl"/>
这意味着 Camel 将 类路径中 的 文件作为 org/apache/camel/component/xslt/staff_template.xsl来查找
您可以使用 classpath: 或 file: 指示 Camel 在 classpath 或文件系统中查找。如果省略前缀,则 Camel 会使用端点配置中的前缀。如果端点配置中没有指定前缀,则默认为 classpath:。
您也可以在 include 路径中向后引用。在以下示例中,xsl 文件将在 org/apache/camel/component 下解析。
<xsl:include href="../staff_other_template.xsl"/>
<xsl:include href="../staff_other_template.xsl"/>