camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satyam Maloo <maloosat...@gmail.com>
Subject Extract values from header in xpath in Spring DSL
Date Mon, 06 Jan 2014 06:50:23 GMT
Consider this xml :
<bookstore>
  <book category="CHILDREN">
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </book>
  <book category="WEB">
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </book>
</bookstore>


I have a set header the header after splitter as 

<camel:setHeader headerName="TEST">
	<camel:xpath>/bookstore/book</camel:xpath>
</camel:setHeader>

Now after performing a few operations I want to find if the category in the
header TEST is CHILDREN, what should the following xpath be?

<camel:when>
	<camel:xpath>*$in.header.TEST*/book/@category=
'CHILDREN'</camel:xpath><camel:when>
	Perform some operation
</camel:when>

I am using camel 2.0.9,  so I if I use headerName in xpath, it throws error.
Kindly suggest what the xpath should be?



-----
Satyam A Maloo
--
View this message in context: http://camel.465427.n5.nabble.com/Extract-values-from-header-in-xpath-in-Spring-DSL-tp5745599.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message