Code example for XPathExpression

Methods: evaluate

    private Object get(XPathExpression expr, QName resultType) {
        Object result = null;
        try { 
            result = expr.evaluate(document, resultType);
        } catch (Throwable t) {
        	throw new IllegalStateException("Xpath can not evaluate.");
        return result;
    public Node getNode(String expression) {
        return (Node) get(expression, XPathConstants.NODE);
	private Node getNode(XPathExpression expr) {
        return (Node) get(expr, XPathConstants.NODE);
Connect your IDE to all the code out there  Get Codota for Java