/** * Method looks up an XPathExpression. A XPathExpression can be precompiled * by using the register mehtods. * * @param xpath the xpath. * @return XPathExpression. */ protected XPathExpression lookUp(final String xpath) { // first simple native implementation XPathExpression expression = (XPathExpression) m_nameToPreCompiledExpressionMap.get(xpath); return expression == null ? preCompile(xpath) : expression; }
/** * Method registers an xpath as precompiled XPathExpression with a special * name. * <p/> * After that you can use the name when ever an xpath is needed. * * @param name the name. * @param xpath the xpath. * @return XMLPathCtx. */ public XMLPathCtx register(final String name, final String xpath) { m_nameToPreCompiledExpressionMap.put(name, preCompile(xpath)); return this; }