camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ext2" <>
Subject an un-easy way to use camel-xpath in:header() function
Date Fri, 20 May 2011 05:10:18 GMT
Using camel's in:header() xpath function,  we can deal with  xml stored in
message header very easy; for example:
	<setHeader name="cheaperBooks">

The setHeader could retrieve all cheaper books(price less than 100) from a
bookstore xml (which already stored in message header('bookstore')

But in camel, things are not always so easy. The user must make sure input
message's body must be a valid XML or null(although the body's content may
have nothing to do with the bookstore xml). Otherwise the above xapth
express will failed; 


Camel's XPath expression should check if the input body's content could be
convert to xml. If the body cannot, then using a null instead of original
message body to do XPathExpression.evaluate;

View raw message