/** * Create an Element reference. * * @param locator - XPath location of the element. * @return Element - Element object referenced by the XPath locator. * @throws XPathExpressionException */ private Element getElement(String locator) throws XPathExpressionException { return (Element) constructAnXPathExpression(locator).evaluate(this.xmlDocument, XPathConstants.NODE); }
/** * Return the result of an XPath query on an XML Document in String format * * @param query - The XPath query * @return String - Result of the query * @throws Exception */ public String performXPathQueryReturnString(String query) throws Exception { return constructAnXPathExpression(query).evaluate(this.xmlDocument, XPathConstants.STRING).toString(); }