解决方案:
maven--
<dependency><groupId>jaxen</groupId><artifactId>jaxen</artifactId><version>1.1.1</version></dependency><dependency><groupId>dom4j</groupId><artifactId>dom4j</artifactId><version>1.6.1</version></dependency>
解析原因:
jaxen的网站这个包的介绍:Jaxen is an open source XPath library written in Java.It is adaptable to many different object models, includingDOM, XOM, dom4j, and JDOM. Is it also possible to writeadapters that treat non-XML trees such as compiled Java byte code or Java beans as XML, thus enabling you to query these trees with XPath too.
JAXEN是一个用Java编写的开源XPath库,它适用于许多不同的对象模型,包括DOM、XOM、DOM4J和JDOM。也可以编写将非XML树(如编译的Java字节码或Java bean)作为XML来处理的适配器,从而使您能够用XPath查询这些树。
Dom4j之所以能够使用XPath来定位,其实是依赖了这个包,所以把这个包导入到工程中,就可以使用了。
jaxen包的官网地址 http://jaxen.codehaus.org/