public TailCall processLeavingTail(XPathContext context) throws XPathException { XPathContext c = context; while (!(c instanceof XPathContextMajor)) { c = c.getCaller(); } XPathContextMajor cm = (XPathContextMajor)c; if (actualParams.length == 1) { cm.setLocalVariable(actualParams[0].getSlotNumber(), actualParams[0].getSelectValue(context)); } else { // we can't overwrite any of the parameters until we've evaluated all of them: test iterate012 Sequence[] oldVars = cm.getAllVariableValues(); Sequence[] newVars = Arrays.copyOf(oldVars, oldVars.length); for (WithParam wp : actualParams) { newVars[wp.getSlotNumber()] = wp.getSelectValue(context); } cm.resetAllVariableValues(newVars); } cm.requestTailCall(this, null); return null; }
public TailCall processLeavingTail(XPathContext context) throws XPathException { XPathContext c = context; while (!(c instanceof XPathContextMajor)) { c = c.getCaller(); } XPathContextMajor cm = (XPathContextMajor)c; if (actualParams.length == 1) { cm.setLocalVariable(actualParams[0].getSlotNumber(), actualParams[0].getSelectValue(context)); } else { // we can't overwrite any of the parameters until we've evaluated all of them: test iterate012 Sequence[] oldVars = cm.getAllVariableValues(); Sequence[] newVars = Arrays.copyOf(oldVars, oldVars.length); for (WithParam wp : actualParams) { newVars[wp.getSlotNumber()] = wp.getSelectValue(context); } cm.resetAllVariableValues(newVars); } cm.requestTailCall(this, null); return null; }