xmlns属性上的Camel XPATH选项包含



我想在包含值的xml命名空间上使用choice。

<Document xmlns="www.ddd.test.123.001">
<properties>...
</Document>

驼色:

from("direct:in")
.choice()
.when().xpath("/Document[@xmlns, contains(., 'test.123')]")
.to("mock:pain:001")

xmlns包含我想要使用的路由值。有可能吗?正确的camelXPath字符串是什么?

我不知道Camel,但在XPath1.0中它应该是

"/*[local-name() = 'Document' and contains(namespace-uri(), 'test.123')]"

不能使用/Document,因为它只匹配没有命名空间的Document元素。

最新更新