1 //------------------------------------------------------------------------------
2 // <copyright file="XPathAncestorIterator.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">[....]</owner>
6 //------------------------------------------------------------------------------
8 namespace MS.Internal.Xml.XPath {
11 using System.Xml.XPath;
12 using System.Diagnostics;
13 using System.Globalization;
15 internal class XPathAncestorIterator: XPathAxisIterator {
16 public XPathAncestorIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf) : base(nav, type, matchSelf) {}
17 public XPathAncestorIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf) : base(nav, name, namespaceURI, matchSelf) {}
18 public XPathAncestorIterator(XPathAncestorIterator other) : base(other) { }
20 public override bool MoveNext() {
23 if(matchSelf && Matches) {
29 while (nav.MoveToParent()) {
38 public override XPathNodeIterator Clone() { return new XPathAncestorIterator(this); }