Claus Ibsen-2, thank you very much!
For the time begin, I did that follows:
---route---
...
<filter>
<method ref="histActAggregator" method="xpathExecute(${headers.history},
'/history/p[@id = "RESTSYBRIGE" and @state != "NN"]')"
/>
<to uri="activemq:queue:RESTRUCT.DECLINE"/>
</filter>
...
---bean 'histActAggregator' ---
...
public boolean xpathExecute(String xml, String xpathStr) {
try {
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
XPathExpression expr = xpath.compile(xpathStr);
InputSource inputSource = new InputSource(new
StringReader(xml));
Boolean result = (Boolean) expr.evaluate(inputSource,
XPathConstants.BOOLEAN);
return result;
} catch (XPathExpressionException ex) {
logger.log(Level.SEVERE, "XPathExpressionException; In xml: " +
xml + "; xpath expression: ", ex);
throw new RuntimeException(ex);
}
}
...
May be the solution isn't very elegantly, but it works :)
thanks
--
View this message in context:
http://camel.465427.n5.nabble.com/xpath-for-header-tp5718190p5718365.html
Sent from the Camel - Users mailing list archive at Nabble.com.