Welcome to mirror list, hosted at ThFree Co, Russian Federation.

XPathNavigator.cs « System.Xml.XPath « System.XML « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ee21e6da8e8716269688663351477fbacbedb1aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
//
// System.Xml.XPath.XPathNavigator
//
// Author:
//   Jason Diamond (jason@injektilo.org)
//
// (C) 2002 Jason Diamond  http://injektilo.org/
//

using System;

namespace System.Xml.XPath
{
	public abstract class XPathNavigator : ICloneable
	{
		#region Constructor

		protected XPathNavigator ()
		{
		}

		#endregion

		#region Properties

		public abstract string BaseURI { get; }

		public abstract bool HasAttributes { get; }

		public abstract bool HasChildren { get; }

		public abstract bool IsEmptyElement { get; }

		public abstract string LocalName { get; }

		public abstract string Name { get; }

		public abstract string NamespaceURI { get; }

		public abstract XmlNameTable NameTable { get; }

		public abstract XPathNodeType NodeType { get; }

		public abstract string Prefix { get; }

		public abstract string Value { get; }

		public abstract string XmlLang { get; }

		#endregion

		#region Methods

		public abstract XPathNavigator Clone ();

		[MonoTODO]
		public virtual XmlNodeOrder ComparePosition (XPathNavigator nav)
		{
			throw new NotImplementedException ();
		}

		[MonoTODO]
		public virtual XPathExpression Compile (string xpath)
		{
			Tokenizer tokenizer = new Tokenizer (xpath);
			XPathParser parser = new XPathParser ();
			Expression expr = (Expression) parser.yyparse (tokenizer);
			return new CompiledExpression (expr);
		}

		public virtual object Evaluate (string xpath)
		{
			return Evaluate (Compile (xpath));
		}

		public virtual object Evaluate (XPathExpression expr)
		{
			return Evaluate (expr, null);
		}

		[MonoTODO]
		public virtual object Evaluate (XPathExpression expr, XPathNodeIterator context)
		{
			// TODO: check casts
			if (context == null)
				context = new SelfIterator (this, new DefaultContext ());
			return ((CompiledExpression) expr).Evaluate ((BaseIterator) context);
		}

		public abstract string GetAttribute (string localName, string namespaceURI);

		public abstract string GetNamespace (string name);
		
		object ICloneable.Clone ()
		{
			return Clone ();
		}

		[MonoTODO]
		public virtual bool IsDescendant (XPathNavigator nav)
		{
			throw new NotImplementedException ();
		}

		public abstract bool IsSamePosition (XPathNavigator other);

		[MonoTODO]
		public virtual bool Matches (string xpath)
		{
			return Matches (Compile (xpath));
		}

		[MonoTODO]
		public virtual bool Matches (XPathExpression expr)
		{
			throw new NotImplementedException ();
		}

		public abstract bool MoveTo (XPathNavigator other);

		public abstract bool MoveToAttribute (string localName, string namespaceURI);

		public abstract bool MoveToFirst ();

		public abstract bool MoveToFirstAttribute ();

		public abstract bool MoveToFirstChild ();

		public bool MoveToFirstNamespace ()
		{
			return MoveToFirstNamespace (XPathNamespaceScope.All);
		}

		public abstract bool MoveToFirstNamespace (XPathNamespaceScope namespaceScope);

		public abstract bool MoveToId (string id);

		public abstract bool MoveToNamespace (string name);

		public abstract bool MoveToNext ();

		public abstract bool MoveToNextAttribute ();

		public bool MoveToNextNamespace ()
		{
			return MoveToNextNamespace (XPathNamespaceScope.All);
		}

		public abstract bool MoveToNextNamespace (XPathNamespaceScope namespaceScope);

		public abstract bool MoveToParent ();

		public abstract bool MoveToPrevious ();

		public abstract void MoveToRoot ();

		public virtual XPathNodeIterator Select (string xpath)
		{
			return Select (Compile (xpath));
		}

		[MonoTODO]
		public virtual XPathNodeIterator Select (XPathExpression expr)
		{
			BaseIterator iter = new SelfIterator (this, new DefaultContext ());
			return ((CompiledExpression) expr).EvaluateNodeSet (iter);
		}

		[MonoTODO]
		public virtual XPathNodeIterator SelectAncestors (XPathNodeType type, bool matchSelf)
		{
			throw new NotImplementedException ();
		}

		[MonoTODO]
		public virtual XPathNodeIterator SelectAncestors (string name, string namespaceURI, bool matchSelf)
		{
			throw new NotImplementedException ();
		}

		[MonoTODO]
		public virtual XPathNodeIterator SelectChildren (XPathNodeType type)
		{
			throw new NotImplementedException ();
		}

		[MonoTODO]
		public virtual XPathNodeIterator SelectChildren (string name, string namespaceURI)
		{
			throw new NotImplementedException ();
		}

		[MonoTODO]
		public virtual XPathNodeIterator SelectDescendants (XPathNodeType type, bool matchSelf)
		{
			throw new NotImplementedException ();
		}

		[MonoTODO]
		public virtual XPathNodeIterator SelectDescendants (string name, string namespaceURI, bool matchSelf)
		{
			throw new NotImplementedException ();
		}

		public override string ToString ()
		{
			return Value;
		}

		#endregion
	}
}