use of com.sun.org.apache.xpath.internal.NodeSet in project Payara by payara.
the class VerifierTest method getNonRuntimeCountNodeSet.
public int getNonRuntimeCountNodeSet(String xpath) {
try {
// int value = -1;
Document d = getVerifierContext().getDocument();
if (d == null)
return -1;
XObject result = XPathAPI.eval(d, xpath, (PrefixResolver) new XpathPrefixResolver(d));
NodeList nl = result.nodelist();
NodeSet ns = new NodeSet(nl);
return ns.getLength();
} catch (Exception ex) {
ex.printStackTrace();
return -1;
}
}
use of com.sun.org.apache.xpath.internal.NodeSet in project Payara by payara.
the class VerifierTest method getCountNodeSet.
/*
* getCountNodeSet( String xpath)
* return the number of nodes for the specified xpath
*/
public int getCountNodeSet(String xpath) {
try {
// int value = -1;
Document d = getVerifierContext().getRuntimeDocument();
if (d == null)
return -1;
NodeSet ns = new NodeSet(XPathAPI.selectNodeList(d, xpath));
return ns.getLength();
} catch (Exception ex) {
ex.printStackTrace();
return -1;
}
}
Aggregations