how to use xpath in camel-context.xml to check if a particular node is exist or not

痴心易碎 提交于 2019-12-04 10:24:11

When using xpath and your xml has namespaces, such as your SOAP message, then you must use namespaces in the xpath expression as well.

There is some details at the Camel docmentation at: http://camel.apache.org/xpath

By using the XML DSL in Camel you can declare the namespace in the XML tag directly such as in the camelContext etc.

<camelContext xmlns="http://camel.apache.org/schema/spring" e2d="http://www.abc.com/Abc11WS">
   ...
   <when>
     <xpath>/e2d:getOrderDetailRequest</xpath>
       ...

But mind that XPaths can be a bit tricky to get working correctly. And that is why we added the logNamespaces in Camel 2.10. See details in the bottom of the this page: http://camel.apache.org/xpath

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!