/** * Evaluates the XPath expression and returns the result coerced to a string. * * @param o Object on which to evaluate the expression; typically a DOM node. * * @return Evaluation result as a string. * * @throws XPathExpressionException On XPath evaluation errors. */ public String evaluateAsString(final Object o) throws XPathExpressionException { return (String) evaluate(o, XPathConstants.STRING); }
/** * Evaluates the XPath expression and returns the result coerced to a node list. * * @param o Object on which to evaluate the expression; typically a DOM node. * * @return Evaluation result as a node list. * * @throws XPathExpressionException On XPath evaluation errors. */ public NodeList evaluateAsNodeList(final Object o) throws XPathExpressionException { return (NodeList) evaluate(o, XPathConstants.NODESET); }