152.9. 使用 xsl:include
Camel 提供自己的 URIResolver
实施。这允许 Camel 从 classpath 加载包含的文件。
例如,以下代码中的 include 文件将相对于起始端点:
<xsl:include href="staff_template.xsl"/>
这意味着,Camel 将在 classpath 中查找文件,存为 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"/>