A way achieve this is with xslt.
Have the header part saved in Camel header and attach that to each split 
message using xslt.

-----Original Message-----
From: calyan.bandi [mailto:calyan.ba...@gmail.com] 
Sent: Wednesday, November 04, 2015 2:38 PM
To: users@camel.apache.org
Subject: Re: How to read XML Payload

Hi Henry,

I tried both the options XPath and tokenize. But they didn't give me the 
desired results. The route is defined as below:

<route>
<from uri="file:xml?noop=true" />
<split>
 <xpath>/PricePlans/Body/customer</xpath>
 <to uri="direct:processCustomer" />
</split>
</route>

The output that i receive from the XPath split is only the customer tag as 
shown below. 

<customer>
...
</customer>

I need the meta-data information in the original XML file to be passed on in 
the output XML. I even tried with the <tokenize /> as shown below but no luck.

<camel:tokenize token="customer" xml="true"
inheritNamespaceTagName="PricePlans" />

Thanks,
Kalyan



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-read-XML-Payload-tp5773337p5773368.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to