Java XPath Expression createXPathExpression(NamespaceContext context, String xPathQuery)

Here you can find the source of createXPathExpression(NamespaceContext context, String xPathQuery)

Description

create X Path Expression

License

Apache License

Declaration

public static XPathExpression createXPathExpression(NamespaceContext context, String xPathQuery)
            throws XPathExpressionException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.xml.namespace.NamespaceContext;

import javax.xml.xpath.XPath;

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

public class Main {
    public static XPathExpression createXPathExpression(NamespaceContext context, String xPathQuery)
            throws XPathExpressionException {
        XPath xpath = XPathFactory.newInstance().newXPath();
        xpath.setNamespaceContext(context);
        return xpath.compile(xPathQuery);
    }/*from www.  j a v a2  s. co m*/
}

Related

  1. createNewXPath(@Nullable final NamespaceContext aNamespaceContext)
  2. createQueryResourcePropertiesCallBody(String aXqueryExpression)
  3. createReverseCMDIComponentItemMap(String urlToComponent)
  4. createXPath()
  5. createXPath(NamespaceContext namespaceContext, XPathFunctionResolver functionResolver)
  6. createXPathExpression(String expression, NamespaceContext namespaceContext)
  7. createXPathExpression(String xpath)
  8. createXPathExpression(String xpathString)
  9. deleteXMLElement(String xml, String xpath)