搜索

第 378 章 XSLT Component

download PDF

从 Camel 版本 1.3 开始提供

xslt: 组件允许您使用 XSLT 模板处理消息。这在使用 Templating 生成请求的重新填充时是理想的选择。

378.1. URI 格式

xslt:templateName[?options]

URI 格式包含 templateName,它可以是以下之一:

  • 要调用的模板的 classpath-local URI
  • 远程模板的完整 URL。

您可以使用以下格式将查询选项附加到 URI 中:

?option=value&option=value&…​

如需 URI 语法的更多详情,请参阅 Spring 文档

表 378.1. URI 示例
URI描述

xslt:com/acme/mytransform.xsl

在 classpath 上引用 com/acme/mytransform.xsl 文件

xslt:file:///foo/bar.xsl

指的是文件 /foo/bar.xsl

xslt:http://acme.com/cheese/foo.xsl

引用远程 http 资源

对于 Camel 2.8 或更早的版本,Maven 用户需要将以下依赖项添加到组件的 pom.xml 中:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-spring</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

Camel 2.9 开始,XSLT 组件直接在 camel-core 中提供。

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.