Spring int-xml:xpath-expression erros with node function

老子叫甜甜 提交于 2019-12-02 05:37:29
Artem Bilan

I don't know how XML Spy does work, but I see that this:

/@exceptionMsg/string-length(.)

is a wrong syntax. string-length() is really an xPath function, but it isn't a node of your XML.

It isn't clear yet what is your goal, but I hope it should help a bit to go right way.

UPDATE

Well, I've figured out what's going on.

You use XPath 2 (How do I select an XML node with the longest child #text node value with XPath?), but Java doesn't have that ability by default.

So you should use some other library. Saxon is the best one on the matter.

However you should do this:

-Djavax.xml.xpath.XPathFactory:http://java.sun.com/jaxp/xpath/dom=net.sf.saxon.xpath.XPathFactoryImpl

Or specify that System property programmatically.

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