/// <summary> /// Get the sequence of items in the form of an <c>IList</c> /// </summary> /// <returns> /// The list of items making up this value. Each item in the list /// will be an object of type <c>XdmItem</c> /// </returns> public IList GetList() { if (value == null) { return(new ArrayList()); } else if (value is Item) { ArrayList list = new ArrayList(1); list.Add((NodeInfo)value); return(list); } else { ArrayList list = new ArrayList(); SequenceIterator iter = ((Value)value).iterate(null); while (true) { Item jitem = iter.next(); if (jitem == null) { break; } list.Add((XdmItem)XdmValue.Wrap(jitem)); } return(list); } }
/// <summary>Reset the enumeration so that the next call of /// <c>MoveNext</c> will position the enumeration at the /// first item in the sequence</summary> public void Reset() { iter = iter.getAnother(); }
internal SequenceEnumerator(SequenceIterator iter) { this.iter = iter; }
/// <summary> /// Invoke the function /// </summary> /// <param name="arguments">The arguments to the function</param> /// <param name="processor">The Saxon processor, used to provide context information</param> /// <returns>The result of calling the function</returns> /// public XdmValue invoke(XdmValue[] arguments, Processor processor) { SequenceIterator[] args = new SequenceIterator[arguments.Length]; for (int i = 0; i < arguments.Length; i++) { args[i] = Value.asIterator(arguments[i].Unwrap()); } JXPathContext context = processor.config.getConversionContext(); SequenceIterator result = ((JFunctionItem)value).invoke(args, context); return XdmValue.Wrap(JSequenceExtent.makeSequenceExtent(result)); }