public TailCall processLeavingTail() throws XPathException { evaluationContext.trackFocus(selectedItems.iterate()); evaluationContext.setCurrentMode(targetMode); evaluationContext.setCurrentComponent(targetMode); return targetMode.getActor().applyTemplates(params, tunnelParams, evaluationContext, locationId); } }
public TailCall processLeavingTail() throws XPathException { evaluationContext.trackFocus(selectedItems.iterate()); evaluationContext.setCurrentMode(targetMode); evaluationContext.setCurrentComponent(targetMode); return targetMode.getActor().applyTemplates(params, tunnelParams, evaluationContext, locationId); } }
/** * Return an Iterator to iterate over the values of a sequence. The value of every * expression can be regarded as a sequence, so this method is supported for all * expressions. This default implementation relies on the process() method: it * "pushes" the results of the instruction to a sequence in memory, and then * iterates over this in-memory sequence. * <p>In principle instructions should implement a pipelined iterate() method that * avoids the overhead of intermediate storage.</p> * * @param context supplies the context for evaluation * @return a SequenceIterator that can be used to iterate over the result * of the expression * @throws XPathException if any dynamic error occurs evaluating the * expression */ /*@NotNull*/ public SequenceIterator<?> iterate(XPathContext context) throws XPathException { GroupIterator master = getGroupIterator(context); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(master); c2.setCurrentGroupIterator(master); c2.setCurrentTemplateRule(null); return new ContextMappingIterator<>(this, c2); }
/** * Return an Iterator to iterate over the values of a sequence. The value of every * expression can be regarded as a sequence, so this method is supported for all * expressions. This default implementation relies on the process() method: it * "pushes" the results of the instruction to a sequence in memory, and then * iterates over this in-memory sequence. * <p>In principle instructions should implement a pipelined iterate() method that * avoids the overhead of intermediate storage.</p> * * @param context supplies the context for evaluation * @return a SequenceIterator that can be used to iterate over the result * of the expression * @throws XPathException if any dynamic error occurs evaluating the * expression */ /*@NotNull*/ public SequenceIterator<?> iterate(XPathContext context) throws XPathException { GroupIterator master = getGroupIterator(context); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(master); c2.setCurrentGroupIterator(master); c2.setCurrentTemplateRule(null); return new ContextMappingIterator<>(this, c2); }
/** * Return an Iterator to iterate over the values of a sequence. The value of every * expression can be regarded as a sequence, so this method is supported for all * expressions. This default implementation handles iteration for expressions that * return singleton values: for non-singleton expressions, the subclass must * provide its own implementation. * * @param context supplies the context for evaluation * @return a SequenceIterator that can be used to iterate over the result * of the expression * @throws net.sf.saxon.trans.XPathException * if any dynamic error occurs evaluating the * expression */ /*@NotNull*/ public SequenceIterator<?> iterate(XPathContext context) throws XPathException { RegexIterator iter = getRegexIterator(context); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(iter); c2.setCurrentRegexIterator(iter); AnalyzeMappingFunction fn = new AnalyzeMappingFunction(iter, c2, getNonMatching(), getMatching()); return new ContextMappingIterator<>(fn, c2); }
/** * Return an Iterator to iterate over the values of a sequence. The value of every * expression can be regarded as a sequence, so this method is supported for all * expressions. This default implementation handles iteration for expressions that * return singleton values: for non-singleton expressions, the subclass must * provide its own implementation. * * @param context supplies the context for evaluation * @return a SequenceIterator that can be used to iterate over the result * of the expression * @throws net.sf.saxon.trans.XPathException * if any dynamic error occurs evaluating the * expression */ /*@NotNull*/ public SequenceIterator<?> iterate(XPathContext context) throws XPathException { RegexIterator iter = getRegexIterator(context); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(iter); c2.setCurrentRegexIterator(iter); AnalyzeMappingFunction fn = new AnalyzeMappingFunction(iter, c2, getNonMatching(), getMatching()); return new ContextMappingIterator(fn, c2); }
/** * Perform the built-in template action for a given item. * @param item the item to be processed * @param parameters the parameters supplied to apply-templates * @param tunnelParams the tunnel parameters to be passed through * @param context the dynamic evaluation context * @param locationId location of the instruction (apply-templates, apply-imports etc) that caused * the built-in template to be invoked @throws net.sf.saxon.trans.XPathException */ public void process(Item item, ParameterSet parameters, ParameterSet tunnelParams, XPathContext context, Location locationId) throws XPathException { if (item instanceof NodeInfo && ((NodeInfo) item).getNodeKind() == Type.DOCUMENT) { XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(((NodeInfo) item).iterateAxis(AxisInfo.CHILD)); c2.setCurrentComponent(c2.getCurrentMode()); TailCall tc = c2.getCurrentMode().getActor().applyTemplates(parameters, tunnelParams, c2, locationId); while (tc != null) { tc = tc.processLeavingTail(); } } // otherwise, do nothing }
/** * Perform the built-in template action for a given item. * @param item the item to be processed * @param parameters the parameters supplied to apply-templates * @param tunnelParams the tunnel parameters to be passed through * @param context the dynamic evaluation context * @param locationId location of the instruction (apply-templates, apply-imports etc) that caused * the built-in template to be invoked @throws net.sf.saxon.trans.XPathException */ public void process(Item item, ParameterSet parameters, ParameterSet tunnelParams, XPathContext context, Location locationId) throws XPathException { if (item instanceof NodeInfo && ((NodeInfo) item).getNodeKind() == Type.DOCUMENT) { XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(((NodeInfo) item).iterateAxis(AxisInfo.CHILD)); c2.setCurrentComponent(c2.getCurrentMode()); TailCall tc = c2.getCurrentMode().getActor().applyTemplates(parameters, tunnelParams, c2, locationId); while (tc != null) { tc = tc.processLeavingTail(); } } // otherwise, do nothing }
XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(node.iterateAxis(AxisInfo.ATTRIBUTE)); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(node.iterateAxis(AxisInfo.CHILD)); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(members);
XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); FocusIterator focusIter = c2.trackFocus(iter); c2.setCurrentRegexIterator(iter);
XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); FocusIterator focusIter = c2.trackFocus(iter); c2.setCurrentRegexIterator(iter);
public TailCall processLeavingTail(XPathContext context) throws XPathException { Controller controller = context.getController(); assert controller != null; PipelineConfiguration pipe = context.getReceiver().getPipelineConfiguration(); GroupIterator groupIterator = getGroupIterator(context); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); FocusIterator focusIterator = c2.trackFocus(groupIterator); c2.setCurrentGroupIterator(groupIterator); c2.setCurrentTemplateRule(null); pipe.setXPathContext(c2); if (controller.isTracing()) { TraceListener listener = controller.getTraceListener(); assert listener != null; Item item; while ((item = focusIterator.next()) != null) { listener.startCurrentItem(item); getActionExpression().process(c2); listener.endCurrentItem(item); } } else { while (focusIterator.next() != null) { getActionExpression().process(c2); } } pipe.setXPathContext(context); return null; }
XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(node.iterateAxis(AxisInfo.CHILD)); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); c2.trackFocus(members);
public TailCall processLeavingTail(XPathContext context) throws XPathException { Controller controller = context.getController(); assert controller != null; PipelineConfiguration pipe = context.getReceiver().getPipelineConfiguration(); GroupIterator groupIterator = getGroupIterator(context); XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); FocusIterator focusIterator = c2.trackFocus(groupIterator); c2.setCurrentGroupIterator(groupIterator); c2.setCurrentTemplateRule(null); pipe.setXPathContext(c2); if (controller.isTracing()) { TraceListener listener = controller.getTraceListener(); assert listener != null; Item item; while ((item = focusIterator.next()) != null) { listener.startCurrentItem(item); getActionExpression().process(c2); listener.endCurrentItem(item); } } else { while (focusIterator.next() != null) { getActionExpression().process(c2); } } pipe.setXPathContext(context); return null; }
public TailCall processLeavingTail(XPathContext context) throws XPathException { XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); FocusIterator iter = c2.trackFocus(getSelectExpression().iterate(context)); c2.setCurrentTemplateRule(null); PipelineConfiguration pipe = c2.getReceiver().getPipelineConfiguration();
public TailCall processLeavingTail(XPathContext context) throws XPathException { XPathContextMajor c2 = context.newContext(); c2.setOrigin(this); FocusIterator iter = c2.trackFocus(getSelectExpression().iterate(context)); c2.setCurrentTemplateRule(null); PipelineConfiguration pipe = c2.getReceiver().getPipelineConfiguration();
FocusIterator<?> iter = c2.trackFocus(getSelect().iterate(context)); c2.setCurrentTemplateRule(null);
FocusIterator<?> iter = c2.trackFocus(getSelect().iterate(context)); c2.setCurrentTemplateRule(null);
c2.trackFocus(iter); c2.setCurrentMode(targetMode); c2.setOrigin(this);
c2.trackFocus(iter); c2.setCurrentMode(targetMode); c2.setOrigin(this);