我继承了一些新手正在使用的XPath代码。我现在有了它,以便它可以加载文档,但是当document.selectPath(queryPath)出现以下错误时,它总是失败:
java.lang.RuntimeException: Trying XBeans path engine... Trying XQRL... Trying delegated path engine... FAILED on //
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:173)
at org.apache.xmlbeans.impl.store.Path.getCompiledPath(Path.java:130)
at org.apache.xmlbeans.impl.store.Cursor._selectPath(Cursor.java:902)
at org.apache.xmlbeans.impl.store.Cursor.selectPath(Cursor.java:2634)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:462)
at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:446)
最佳答案
您的类路径中需要一个XPath引擎,该引擎依赖于XMLBeans版本,请参见
http://wiki.apache.org/xmlbeans/XmlBeansFaq#whatJars
关于java - XPath找不到引擎,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/528499/