1 //------------------------------------------------------------------------------
2 // <copyright file="ParentQuery.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 //------------------------------------------------------------------------------
8 namespace MS.Internal.Xml.XPath {
11 using System.Xml.XPath;
12 using System.Diagnostics;
13 using System.Globalization;
14 using System.Collections.Generic;
16 internal sealed class ParentQuery : CacheAxisQuery {
18 public ParentQuery(Query qyInput, string Name, string Prefix, XPathNodeType Type) : base(qyInput, Name, Prefix, Type) {}
19 private ParentQuery(ParentQuery other) : base(other) { }
21 public override object Evaluate(XPathNodeIterator context) {
22 base.Evaluate(context);
26 while ((input = qyInput.Advance()) != null) {
27 input = input.Clone();
29 if (input.MoveToParent()) {
31 Insert(outputBuffer, input);
38 public override XPathNodeIterator Clone() { return new ParentQuery(this); }