Here you can find the source of getXPathExpression(String xpathStr)
Parameter | Description |
---|---|
xpathStr | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static XPathExpression getXPathExpression(String xpathStr) throws Exception
//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); } }