/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * * * @return A valid DTMIterator. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); return execute(xctxt).iter(); } finally { xctxt.popCurrentNodeAndExpression(); } }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator, but do not clone. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * * * @return A valid DTMIterator. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); XNodeSet nodeset = (XNodeSet)execute(xctxt); return nodeset.iterRaw(); } finally { xctxt.popCurrentNodeAndExpression(); } }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator, but do not clone. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * * * @return A valid DTMIterator. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); XNodeSet nodeset = (XNodeSet)execute(xctxt); return nodeset.iterRaw(); } finally { xctxt.popCurrentNodeAndExpression(); } }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * * * @return A valid DTMIterator. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); return execute(xctxt).iter(); } finally { xctxt.popCurrentNodeAndExpression(); } }
xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
xctxt.pushCurrentNodeAndExpression(contextNode, contextNode);
xctxt.pushCurrentNodeAndExpression(targetNode, targetNode); try
xctxt.pushCurrentNodeAndExpression(targetNode, targetNode); try
xctxt.pushCurrentNodeAndExpression(current, current);
xctxt.pushCurrentNodeAndExpression(targetNode, targetNode); try
xctxt.pushCurrentNodeAndExpression(targetNode, targetNode); try
xctxt.pushCurrentNodeAndExpression(current, current);
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * * * @return A valid DTMIterator. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); return execute(xctxt).iter(); } finally { xctxt.popCurrentNodeAndExpression(); } }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * * * @return A valid DTMIterator. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); return execute(xctxt).iter(); } finally { xctxt.popCurrentNodeAndExpression(); } }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * * * @return A valid DTMIterator. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIterator(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); return execute(xctxt).iter(); } finally { xctxt.popCurrentNodeAndExpression(); } }
/** * Given an select expression and a context, evaluate the XPath * and return the resulting iterator, but do not clone. * * @param xctxt The execution context. * @param contextNode The node that "." expresses. * * * @return A valid DTMIterator. * @throws TransformerException thrown if the active ProblemListener decides * the error condition is severe enough to halt processing. * * @throws javax.xml.transform.TransformerException * @xsl.usage experimental */ public DTMIterator asIteratorRaw(XPathContext xctxt, int contextNode) throws javax.xml.transform.TransformerException { try { xctxt.pushCurrentNodeAndExpression(contextNode, contextNode); XNodeSet nodeset = (XNodeSet)execute(xctxt); return nodeset.iterRaw(); } finally { xctxt.popCurrentNodeAndExpression(); } }
/** * Return the XPathContext to be used for evaluating expressions. * * If the child is nested withing a forEach tag its iteration context is used. * Otherwise, a new context is created based on an empty Document. * * @param child the tag whose context should be returned * @param pageContext the current page context * @return the XPath evaluation context */ public static XPathContext getContext(Tag child, PageContext pageContext) { // if within a forEach tag, use its context ForEachTag forEachTag = (ForEachTag) TagSupport.findAncestorWithClass(child, ForEachTag.class); if (forEachTag != null) { return forEachTag.getContext(); } // otherwise, create a new context referring to an empty document XPathContext context = new XPathContext(false); VariableStack variableStack = new JSTLVariableStack(pageContext); context.setVarStack(variableStack); int dtm = context.getDTMHandleFromNode(XmlUtil.newEmptyDocument()); context.pushCurrentNodeAndExpression(dtm, dtm); return context; }
/** * Return the XPathContext to be used for evaluating expressions. * * If the child is nested withing a forEach tag its iteration context is used. * Otherwise, a new context is created based on an empty Document. * * @param child the tag whose context should be returned * @param pageContext the current page context * @return the XPath evaluation context */ public static XPathContext getContext(Tag child, PageContext pageContext) { // if within a forEach tag, use its context ForEachTag forEachTag = (ForEachTag) TagSupport.findAncestorWithClass(child, ForEachTag.class); if (forEachTag != null) { return forEachTag.getContext(); } // otherwise, create a new context referring to an empty document XPathContext context = new XPathContext(false); VariableStack variableStack = new JSTLVariableStack(pageContext); context.setVarStack(variableStack); int dtm = context.getDTMHandleFromNode(XmlUtil.newEmptyDocument()); context.pushCurrentNodeAndExpression(dtm, dtm); return context; }