/** * 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 releases a XPath back in the pool. * * @param xPath the transformer. */ public void release(final XPath xPath) { xPath.reset(); this.release(xPath, null); }