/** * Method pre compiles an xpath expression. * * @param xpath the xpath. * @return XPathExpression. */ private XPathExpression preCompile(final String xpath) { XPath path = getXPathPool().acquire(); try { path.setNamespaceContext(m_namespaceContext); return path.compile(xpath); } catch (XPathExpressionException e) { throw new XMLPathException(e); } finally { getXPathPool().release(path); } }
/** * Method acquires a new XPath from the pool. * * @return XPath. */ public XPath acquire() { return this.acquire(null); }