Java XPath Evaluate evaluateXPathExpr(XPathExpression xpath, Node node)

Here you can find the source of evaluateXPathExpr(XPathExpression xpath, Node node)

Description

evaluate X Path Expr

License

Apache License

Declaration

public static NodeList evaluateXPathExpr(XPathExpression xpath, Node node) throws XPathExpressionException 

Method Source Code

//package com.java2s;
/*/*from  w  ww.  ja  v a2 s .co m*/
 * Copyright 2013 Future Systems
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;

import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class Main {
    public static NodeList evaluateXPathExpr(XPathExpression xpath, Node node) throws XPathExpressionException {
        return (NodeList) xpath.evaluate(node, XPathConstants.NODESET);
    }
}

Related

  1. evaluateXPath(String path, Node e, QName type)
  2. evaluateXPath(String xpath, Object item, QName returnType)
  3. evaluateXPathAsNodeList(String expression, Document document)
  4. evaluateXPathBool(final Node inNode, final String xpath)
  5. evaluateXPathExpr(final File xmlFile, final XPathExpression xPathExpression, final QName returnType)
  6. evaluateXPathExpression(final String expression, final Node node)
  7. evaluateXPathExpressionAndReturnNode(String expression, Node node)
  8. evaluateXPathExpressionAndReturnNodeList(String expression, Node node)
  9. evaluateXPathQuery(Document doc, NamespaceContext context, String xPathQuery)