Have you looked at the Validation component?
http://camel.apache.org/validation.html

On Fri, May 20, 2011 at 7:10 AM, ext2 <[email protected]> wrote:

> Using camel's in:header() xpath function,  we can deal with  xml stored in
> message header very easy; for example:
>        <setHeader name="cheaperBooks">
>                <xpath>in:header('bookstore')/child::book[price<100]</xpath>
>        </setHeader>
>
> 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;
>
> Suggestion(Maybe):
>
> 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;
>
>
>

Reply via email to