camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chris.koester" <>
Subject XPathBuilder used in Processor() throws XPathException for header variables
Date Mon, 13 Aug 2012 14:04:11 GMT
I am trying to get a camel header variable via an xpath expression in a

import org.apache.camel.builder.xml.XPathBuilder;

	.process(new Processor() {

		public void process(Exchange ex) throws Exception {

		result = XPathBuilder.xpath("in:header('breadcrumbId')")
							.evaluate(ex, String.class);


However this will trow a 
"XPathException: Can not convert #STRING to a NodeList!" exception.
Trying simlpe xpath expressions like "foo/bar" works, so this might be an
error in the camel XPathBuilder.

While debugging it is getting the actual breadcrumb id, but although the
result type is set to String there seems to happen a convertion to a
NodeList, which fails.

Am I using it wrong or is this a bug?


View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message