我和成员们一起上课-
private Document myDoc;
XPath xpath = XPathFactory.newInstance().newXPath();
我尝试使用evaluate
功能 -
Object result = xpath.evaluate(expression, this.myDoc,
XPathConstants.NODESET);
什么时候expression
是string
st
expression = "inventory/book[" +
"count(following-sibling::book/price/text()=14.95)=0 ]" ;
我得到以下异常 -
java.lang.RuntimeException: Can not convert #BOOLEAN to a NodeList!
即使我更改XPathConstants.NODESET
为XPathConstants.NUMBER
我得到相同的异常。提前致谢 。