Evaluate XPath on the url document.

@param xpath
@return xpath evaluator
@see org.xmlbeam.evaluation.CanEvaluate#evalXPath(java.lang.String)
346710
@Override
    @Scope(DocScope.IO)
    public XPathEvaluator evalXPath(final String xpath) {
        return new DefaultXPathEvaluator(projector, new DocumentResolver() {
            @Override
            public Document resolve(final Class<?>... resourceAwareClasses) throws IOException {
                return IOHelper.getDocumentFromURL(projector.config().createDocumentBuilder(), url, requestProperties, resourceAwareClasses);
            }
        }, xpath);
    }
689864
public <T> T get(String xPath, Class<T> returnType) throws Exception {
		XPathQuery xp = new XPathQuery(xPath);
		return xp.eval(this, returnType);
	}
1269752
public @Nonnull Stream<XQuery> select(String xpath) {
        return new NodeListSpliterator(evaluate(xpath)).stream().map(XQuery::new);
    }
183466
public static void assertXpathEvaluatesTo(QualifiedName expectedValue,
                                              String xpathExpression,
                                              Document inDocument)
        throws XpathException {
        XpathEngine simpleXpathEngine = XMLUnit.newXpathEngine();
        NodeList nl =
            simpleXpathEngine.getMatchingNodes(xpathExpression, inDocument);
        NamespaceContext ctx = null;
        if (nl.getLength() > 0) {
            ctx = new NodeBasedNamespaceContext(nl.item(0));
        }
        assertEquals(expectedValue,
                     QualifiedName
                     .valueOf(simpleXpathEngine.evaluate(xpathExpression,
                                                         inDocument),
                              ctx));
    }
592972
public static Node asNode(String nodeName, Node node, XPath xpath)
            throws XPathExpressionException {
        if (node == null) return null;
        return (Node) xpath.evaluate(nodeName, node, XPathConstants.NODE);
    }
334957
public static void assertXpathValuesEqual(String controlXpath,
                                              Document controlDocument,
                                              String testXpath,
                                              Document testDocument)
        throws XpathException {
        XpathEngine xpath = XMLUnit.newXpathEngine();
        assertEquals(xpath.evaluate(controlXpath, controlDocument),
                     xpath.evaluate(testXpath, testDocument));
    }
14311
public static Object executeXPath(Node document, XPathExpression expr, QName result) throws XPathException, MarshallingException
    {
        try
        {
            return expr.evaluate(document, result);
        }
        catch (Exception e)
        {
            throw new MarshallingException("Exception unmarshalling XML.", e);
        }
    }
3646
public String evaluate(String select, Document document)
        throws ConfigurationException, XpathException {
        try {
            StringWriter writer = new StringWriter();
            StreamResult result = new StreamResult(writer);
            performTransform(getValueTransformation(select), document, result);
            return writer.toString();
        } catch (TransformerException ex) {
            throw new XpathException("Failed to apply stylesheet", ex);
        }
    }
300838
public XMLResource xml(JSONPathQuery path) throws Exception {
		Object jsonValue = path.eval(this);
		return xml(jsonValue.toString());
	}
244701
public static void assertXpathExists(String xPathExpression, 
                                         InputSource control)
        throws IOException, SAXException, XpathException {
        Document inDocument = XMLUnit.buildControlDocument(control);
        assertXpathExists(xPathExpression, inDocument);
    }
917092
public static void assertXpathExists(String xPathExpression, 
                                         Document inDocument)
        throws XpathException {
        XpathEngine simpleXpathEngine = XMLUnit.newXpathEngine();
        NodeList nodeList = simpleXpathEngine.getMatchingNodes(
                                                               xPathExpression, inDocument);
        int matches = nodeList.getLength();
        assertTrue("Expecting to find matches for Xpath " + 
                   xPathExpression, matches > 0);
    }
1116762
public static void assertXpathsNotEqual(String controlXpath,
                                            String testXpath,
                                            Document document)
        throws XpathException {
        assertXpathsNotEqual(controlXpath, document, testXpath, document);
    }
268557
public MultipleNodeAssert nodesByXPath(String xPath) {
        isNotNull();
        try {
            return MultipleNodeAssert.create(actual, prefix2Uri, dbf, xpf, xPath);
        } catch (Exception e) {
            throwAssertionError(shouldNotHaveThrown(e));
        }
        return null; //fix compile issue
    }
378242
public static int getXPathLocation(String dom, String xpath) {
		String dom_lower = dom.toLowerCase();
		String xpath_lower = xpath.toLowerCase();
		String[] elements = xpath_lower.split("/");
		int pos = 0;
		int temp;
		int number;
		for (String element : elements) {
			if (!element.isEmpty() && !element.startsWith("@") && !element.contains("()")) {
				if (element.contains("[")) {
					try {
						number =
								Integer.parseInt(element.substring(element.indexOf("[") + 1,
										element.indexOf("]")));
					} catch (NumberFormatException e) {
						return -1;
					}
				} else {
					number = 1;
				}
				for (int i = 0; i < number; i++) {
					// find new open element
					temp = dom_lower.indexOf("<" + stripEndSquareBrackets(element), pos);

					if (temp > -1) {
						pos = temp + 1;

						// if depth>1 then goto end of current element
						if (number > 1 && i < number - 1) {
							pos =
									getCloseElementLocation(dom_lower, pos,
											stripEndSquareBrackets(element));
						}

					}
				}
			}
		}
		return pos - 1;
	}
675150
public function iFollowXpath($xpath)
    {
        $result = $this->getSession()->getPage()->find('xpath', $xpath);

        if (is_null($result)) {
            // We did not find the link or we've found more than we want
            throw new ExpectationException(
                sprintf(
                    'The xpath %s (on %s) returned no elements',
                    $xpath,
                    $this->getSession()->getCurrentUrl()
                ),
                $this->getSession()->getDriver()
            );
        }

        $result->click();
    }
512607
@Override
	NodeList eval(XMLResource resource) throws Exception {
		NodeList retVal = (NodeList) xPathExpression.evaluate(resource.doc(), XPathConstants.NODESET);
		return retVal;
	}
1071144
@Nonnull
  public static XPath createNewXPath ()
  {
    return createNewXPath (s_aXPathFactory,
                           (XPathVariableResolver) null,
                           (XPathFunctionResolver) null,
                           (NamespaceContext) null);
  }