I ran into an issue with a combination of using split and the XSLT
component. I have a XML body that that has a <?xml…> header on it with
multiple elements.* *When I run it through split, it works and I get
multiple messages but the split docs don't have <?xml…> header. When I try
and run that split doc (without the <?xml…>) through an XSLT transform it
doesn't work. So I had to add another step in my route to manually add the
<?xml…> to the body before calling the XSLT to get it to work.
Here is the route that works. If I remove the setBody it fails (no errors,
just no output)
<camel:split>
<camel:xpath>/parcelList/Parcel</camel:xpath>
<camel:setBody><camel:simple><?xml version="1.0"
encoding="UTF-8"?>${body}</camel:simple></camel:setBody>
<camel:to uri="xslt:config/transform-2.xsl"/>
<camel:to uri="activemq:queue:SubmittedParcels"/>
</camel:split>
Is there a better workaround for that?
Chris