Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the asciidoc in the repository: https://github.com/apache/camel/blob/master/README.md https://github.com/apache/camel/blob/master/components/readme.adoc
Available as of Camel 2.9
The StAX component allows messages to be process through a SAX ContentHandler.
Maven users will need to add the following dependency to their
From Camel 2.11.1 onwards you can lookup a
Usage of a content handler as StAX parser
The message body after the handling is the handler itself.
Here an example:
Iterate over a collection using JAXB and StAX
First we suppose you have JAXB objects.
For instance a list of records in a wrapper object:
Then you get a XML file to process:
The StAX component provides an
The previous example with XML DSL
The example above could be implemented as follows in XML DSL