Xpath evaluate count in “[ ]”

james486

New Member
i have class with the members -\[code\]private Document myDoc;XPath xpath = XPathFactory.newInstance().newXPath(); \[/code\]i try to use \[code\]evaluate\[/code\] function - \[code\]Object result = xpath.evaluate(expression, this.myDoc, XPathConstants.NODESET);\[/code\]when \[code\]expression\[/code\] is a \[code\]string\[/code\] s.t \[code\]expression = "inventory/book[" + "count(following-sibling::book/price/text()=14.95)=0 ]" ;\[/code\]and i get the follow exception -\[code\]java.lang.RuntimeException: Can not convert #BOOLEAN to a NodeList!\[/code\]even when i change \[code\]XPathConstants.NODESET\[/code\] to \[code\]XPathConstants.NUMBER\[/code\] i get same exception . thanks in advance .
 
Back
Top