Java XPath Create getXPathExpression(String xpathStr)

Here you can find the source of getXPathExpression(String xpathStr)

Description

Get xpath expression object by xpath string

License

Open Source License

Parameter

Parameter Description
xpathStr a parameter

Exception

Parameter Description
Exception an exception

Declaration

public static XPathExpression getXPathExpression(String xpathStr) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    /**/*from  ww w . j a v a  2 s  .  c o m*/
     * Get xpath expression object by xpath string
     * 
     * @param xpathStr
     * @return
     * @throws Exception
     */
    public static XPathExpression getXPathExpression(String xpathStr) throws Exception {
        return XPathFactory.newInstance().newXPath().compile(xpathStr);
    }
}

Related

  1. getXPath(String expression)
  2. getXPathExpression(final Node node)
  3. getXPathExpression(String expression)
  4. getXPathExpression(String path)
  5. getXPathExpression(String xpath, NamespaceContext namespaceContext)
  6. getXPathExpression(String xPathString)
  7. getXpathExpressionNode(Object xprContext, String xpExpression)
  8. getXpathExpressionValue(Object xprContext, String xpExpression)
  9. getXPathExprFromNode(Node node)