Can you test that very particular example on your Camel installation? Make
sure you add the resultType attribute on the xpath element, i.e.
resultType="java.lang.String". Otherwise it is assumed that the result will
be a NodeList which it isn't in this case.

It looks like we may have lost the culprit of this error due to
oversimplification of the example for posting.

On the other hand, if it actually fails on your environment, please post
the version of Camel you are running on and more details of the environment
;)

On 7 December 2011 20:45, MichaelAtSAG <[email protected]> wrote:

> I receive errors when trying to use xpath functions. My example below is
> simplified, but I want to use an xpath expression to set a header property
> in the Camel Spring XML context, like this:
>
> Camel context:
> -----
> <camelContext xmlns="http://camel.apache.org/schema/spring";>
>        <route id="Test">
>                <setHeader headerName="Test">
>                        <xpath>string(315)</xpath>
>                </setHeader>
>        </route>
> </camelContext>
>
>
> Error:
> -----
> org.apache.camel.builder.xml.InvalidXPathExpression: Invalid xpath:
> string(315). Reason: javax.xml.xpath.XPathExpressionException
>
> How do I write this xpath expression in Camel?
>
> Any help is greatly appreciated.
>
> Thanks!
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-do-I-use-xpath-functions-in-Camel-tp5056913p5056913.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to