I am trying to get a camel header variable via an xpath expression in a
processor.
import org.apache.camel.builder.xml.XPathBuilder;
...
from(endpointUri)
.process(new Processor() {
@Override
public void process(Exchange ex) throws Exception {
result = XPathBuilder.xpath("in:header('breadcrumbId')")
.evaluate(ex,
String.class);
}
}}).end();
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?
Trace: http://pastebin.com/ESZTx53R
--
View this message in context:
http://camel.465427.n5.nabble.com/XPathBuilder-used-in-Processor-throws-XPathException-for-header-variables-tp5717243.html
Sent from the Camel - Users mailing list archive at Nabble.com.