5 // Jason Diamond (jason@injektilo.org)
7 // (C) 2001, 2002 Jason Diamond http://injektilo.org/
12 public abstract class XmlReader
16 protected XmlReader ()
24 public abstract int AttributeCount { get; }
26 public abstract string BaseURI { get; }
28 public virtual bool CanResolveEntity
33 public abstract int Depth { get; }
35 public abstract bool EOF { get; }
37 public virtual bool HasAttributes
39 get { return AttributeCount > 0; }
42 public abstract bool HasValue { get; }
44 public abstract bool IsDefault { get; }
46 public abstract bool IsEmptyElement { get; }
48 public abstract string this[int i] { get; }
50 public abstract string this[string name] { get; }
52 public abstract string this[
57 public abstract string LocalName { get; }
59 public abstract string Name { get; }
61 public abstract string NamespaceURI { get; }
63 public abstract XmlNameTable NameTable { get; }
65 public abstract XmlNodeType NodeType { get; }
67 public abstract string Prefix { get; }
69 public abstract char QuoteChar { get; }
71 public abstract ReadState ReadState { get; }
73 public abstract string Value { get; }
75 public abstract string XmlLang { get; }
77 public abstract XmlSpace XmlSpace { get; }
83 public abstract void Close ();
85 public abstract string GetAttribute (int i);
87 public abstract string GetAttribute (string name);
89 public abstract string GetAttribute (
91 string namespaceName);
93 public static bool IsName (string s)
97 if (s != null && s.Length > 0) {
98 char[] chars = s.ToCharArray ();
100 if (XmlChar.IsFirstNameChar (chars[0])) {
102 int n = chars.Length;
104 while (i < n && XmlChar.IsNameChar (chars[i]))
114 public static bool IsNameToken (string s)
118 if (s != null && s.Length > 0) {
119 char[] chars = s.ToCharArray ();
122 int n = chars.Length;
124 while (i < n && XmlChar.IsNameChar (chars[i]))
134 public virtual bool IsStartElement ()
136 throw new NotImplementedException ();
140 public virtual bool IsStartElement (string name)
142 throw new NotImplementedException ();
146 public virtual bool IsStartElement (
148 string namespaceName)
150 throw new NotImplementedException ();
153 public abstract string LookupNamespace (string prefix);
155 public abstract void MoveToAttribute (int i);
157 public abstract bool MoveToAttribute (string name);
159 public abstract bool MoveToAttribute (
161 string namespaceName);
164 public virtual XmlNodeType MoveToContent ()
166 throw new NotImplementedException ();
169 public abstract bool MoveToElement ();
171 public abstract bool MoveToFirstAttribute ();
173 public abstract bool MoveToNextAttribute ();
175 public abstract bool Read ();
177 public abstract bool ReadAttributeValue ();
180 public virtual string ReadElementString ()
182 throw new NotImplementedException ();
186 public virtual string ReadElementString (string name)
188 throw new NotImplementedException ();
192 public virtual string ReadElementString (
194 string namespaceName)
196 throw new NotImplementedException ();
200 public virtual void ReadEndElement ()
202 throw new NotImplementedException ();
205 public abstract string ReadInnerXml ();
207 public abstract string ReadOuterXml ();
210 public virtual void ReadStartElement ()
212 throw new NotImplementedException ();
216 public virtual void ReadStartElement (string name)
218 throw new NotImplementedException ();
222 public virtual void ReadStartElement (
224 string namespaceName)
226 throw new NotImplementedException ();
229 public abstract string ReadString ();
231 public abstract void ResolveEntity ();
234 public virtual void Skip ()
236 throw new NotImplementedException ();