private UnionIterator(UnionIterator other) : base(other) { _left = (BaseIterator)other._left.Clone(); _right = (BaseIterator)other._right.Clone(); keepLeft = other.keepLeft; keepRight = other.keepRight; if (other._current != null) { _current = other._current.Clone(); } }
private UnionIterator (UnionIterator other) : base (other) { _left = (BaseIterator) other._left.Clone (); _right = (BaseIterator) other._right.Clone (); keepLeft = other.keepLeft; keepRight = other.keepRight; if (other._current != null) _current = other._current.Clone (); }
// Invoked from XsltKey (XPathFunction) public BaseIterator Evaluate (BaseIterator iter, Expression valueExpr) { XPathNodeIterator i = iter; if (iter.CurrentPosition == 0) { i = iter.Clone (); i.MoveNext (); } XPathNavigator nav = i.Current; object o = valueExpr.Evaluate (iter); XPathNodeIterator it = o as XPathNodeIterator; XsltContext ctx = iter.NamespaceManager as XsltContext; BaseIterator result = null; if (it != null) { while (it.MoveNext()) { ArrayList nodes = GetNodesByValue ( nav, it.Current.Value, ctx); if (nodes == null) continue; ListIterator tmp = new ListIterator (nodes, ctx); if (result == null) result = tmp; else result = new UnionIterator ( iter, result, tmp); } } else if (nav != null) { ArrayList nodes = GetNodesByValue ( nav, XPathFunctions.ToString (o), ctx); if (nodes != null) result = new ListIterator (nodes, ctx); } return result != null ? result : new NullIterator (iter); }