/** * Get the current regex iterator. This supports the functionality of the regex-group() * function in XSLT 2.0. * @return the current regular expressions iterator */ public RegexIterator getCurrentRegexIterator() { return getCaller().getCurrentRegexIterator(); }
/** * Get the current regex iterator. This supports the functionality of the regex-group() * function in XSLT 2.0. * @return the current regular expressions iterator */ public RegexIterator getCurrentRegexIterator() { return getCaller().getCurrentRegexIterator(); }
/** * Get the current regex iterator. This supports the functionality of the regex-group() * function in XSLT 2.0. * @return the current regular expressions iterator */ public RegexIterator getCurrentRegexIterator() { return getCaller().getCurrentRegexIterator(); }
/** * Get the current regex iterator. This supports the functionality of the regex-group() * function in XSLT 2.0. * * @return the current regular expressions iterator */ public RegexIterator getCurrentRegexIterator() { return getCaller().getCurrentRegexIterator(); }
/** * Get the current regex iterator. This supports the functionality of the regex-group() * function in XSLT 2.0. * * @return the current regular expressions iterator */ public RegexIterator getCurrentRegexIterator() { return getCaller().getCurrentRegexIterator(); }
/** * Evaluate in a general context */ public Item evaluateItem(XPathContext c) throws XPathException { AtomicValue gp0 = (AtomicValue)argument[0].evaluateItem(c); NumericValue gp = (NumericValue)gp0; RegexIterator iter = c.getCurrentRegexIterator(); if (iter == null) { return StringValue.EMPTY_STRING; } String s = iter.getRegexGroup((int)gp.longValue()); if (s == null) { return StringValue.EMPTY_STRING; } return StringValue.makeStringValue(s); }
/** * Evaluate in a general context */ public Item evaluateItem(XPathContext c) throws XPathException { AtomicValue gp0 = (AtomicValue)argument[0].evaluateItem(c); NumericValue gp = (NumericValue)gp0; RegexIterator iter = c.getCurrentRegexIterator(); if (iter == null) { return StringValue.EMPTY_STRING; } String s = iter.getRegexGroup((int)gp.longValue()); if (s == null) { return StringValue.EMPTY_STRING; } return StringValue.makeStringValue(s); }
/** * Evaluate in a general context */ public Item evaluateItem(XPathContext c) throws XPathException { AtomicValue gp0 = (AtomicValue)argument[0].evaluateItem(c); NumericValue gp = (NumericValue)gp0; RegexIterator iter = c.getCurrentRegexIterator(); if (iter == null) { return StringValue.EMPTY_STRING; } String s = iter.getRegexGroup((int)gp.longValue()); if (s == null) { return StringValue.EMPTY_STRING; } return StringValue.makeStringValue(s); }
/** * Evaluate the expression * * @param context the dynamic evaluation context * @param arguments the values of the arguments, supplied as Sequences * @return the result of the evaluation, in the form of a Sequence * @throws net.sf.saxon.trans.XPathException * if a dynamic error occurs during the evaluation of the expression */ public StringValue call(XPathContext context, Sequence[] arguments) throws XPathException { RegexIterator iter = context.getCurrentRegexIterator(); if (iter == null) { return StringValue.EMPTY_STRING; } NumericValue gp0 = (NumericValue) arguments[0].head(); String s = iter.getRegexGroup((int) gp0.longValue()); return StringValue.makeStringValue(s); } }
/** * Evaluate the expression * * @param context the dynamic evaluation context * @param arguments the values of the arguments, supplied as Sequences * @return the result of the evaluation, in the form of a Sequence * @throws net.sf.saxon.trans.XPathException * if a dynamic error occurs during the evaluation of the expression */ public StringValue call(XPathContext context, Sequence[] arguments) throws XPathException { RegexIterator iter = context.getCurrentRegexIterator(); if (iter == null) { return StringValue.EMPTY_STRING; } NumericValue gp0 = (NumericValue) arguments[0].head(); String s = iter.getRegexGroup((int) gp0.longValue()); return StringValue.makeStringValue(s); } }
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.currentMergeGroupIterator = null;
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
/** * Create a new "major" context (one that is capable of holding a stack frame with local variables * @param prev the previous context (the one causing the new context to be created) * @return the new major context */ public static XPathContextMajor newContext(XPathContextMinor prev) { XPathContextMajor c = new XPathContextMajor(); XPathContext p = prev; while (!(p instanceof XPathContextMajor)) { p = p.getCaller(); } c.controller = p.getController(); c.currentIterator = prev.getCurrentIterator(); c.stackFrame = prev.getStackFrame(); c.localParameters = p.getLocalParameters(); c.tunnelParameters = p.getTunnelParameters(); c.last = prev.last; c.currentReceiver = prev.currentReceiver; c.isTemporaryDestination = prev.isTemporaryDestination; c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.caller = prev; c.tailCallFunction = null; return c; }
c.currentMode = p.getCurrentMode(); c.currentTemplate = p.getCurrentTemplateRule(); c.currentRegexIterator = p.getCurrentRegexIterator(); c.currentGroupIterator = p.getCurrentGroupIterator(); c.currentMergeGroupIterator = null;