Transforming inline with XQuery
Camel supports the use of Camel's XQuery Expression Language along with the transform
statement as a quick and easy way to transform an XML message within a route.
This recipe will show you how to use an XQuery Expression to do in-route XML transformation.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.transformation.xquery
package. Spring XML files are located under src/main/resources/META-INF/spring
and prefixed with xquery
.
To use the XQuery Expression Language, you need to add a dependency
element for the camel-saxon
library, which provides the implementation for the XQuery Expression Language.
Add the following to the dependencies
section of your Maven POM:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-saxon</artifactId> <version>${camel-version}</version> </dependency>
How to do it...
In the Camel route, specify a transform
statement followed by the XQuery...