Here you can find the source of getXpathExpression(String s)
public static XPathExpression getXpathExpression(String s) throws XPathExpressionException
//package com.java2s; 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 getXpathExpression(String s) throws XPathExpressionException { return getXPath().compile(s); }/* ww w.ja v a 2 s . co m*/ public static XPath getXPath() { return XPathFactory.newInstance().newXPath(); } }