2 // System.Xml.XmlAttribute
5 // Jason Diamond (jason@injektilo.org)
7 // (C) 2002 Jason Diamond http://injektilo.org/
14 public class XmlElement : XmlLinkedNode
18 private XmlAttributeCollection attributes;
19 private string localName;
20 private string namespaceURI;
21 private string prefix;
27 protected internal XmlElement (
31 XmlDocument doc) : base (doc)
34 this.localName = localName;
35 this.namespaceURI = namespaceURI;
37 attributes = new XmlAttributeCollection (this);
44 public override XmlAttributeCollection Attributes {
50 public virtual bool HasAttributes {
52 return attributes.Count > 0;
57 public override string InnerText {
59 throw new NotImplementedException ();
63 throw new NotImplementedException ();
68 public override string InnerXml {
70 throw new NotImplementedException ();
74 throw new NotImplementedException ();
81 throw new NotImplementedException ();
85 throw new NotImplementedException ();
89 public override string LocalName {
95 public override string Name {
97 return prefix != String.Empty ? prefix + ":" + localName : localName;
101 public override string NamespaceURI {
108 public override XmlNode NextSibling {
110 return base.NextSibling;
114 public override XmlNodeType NodeType {
116 return XmlNodeType.Element;
121 public override XmlDocument OwnerDocument {
123 return base.OwnerDocument;
127 public override string Prefix {
138 public override XmlNode CloneNode (bool deep)
140 throw new NotImplementedException ();
144 public virtual string GetAttribute (string name)
146 XmlNode attributeNode = Attributes.GetNamedItem (name);
147 return attributeNode != null ? attributeNode.Value : String.Empty;
151 public virtual string GetAttribute (string localName, string namespaceURI)
153 throw new NotImplementedException ();
157 public virtual XmlAttribute GetAttributeNode (string name)
159 throw new NotImplementedException ();
163 public virtual XmlAttribute GetAttributeNode (string localName, string namespaceURI)
165 throw new NotImplementedException ();
169 public virtual XmlNodeList GetElementsByTagName (string name)
171 throw new NotImplementedException ();
175 public virtual XmlNodeList GetElementsByTagName (string localName, string namespaceURI)
177 throw new NotImplementedException ();
181 public virtual bool HasAttribute (string name)
183 throw new NotImplementedException ();
187 public virtual bool HasAttribute (string localName, string namespaceURI)
189 throw new NotImplementedException ();
192 [MonoTODO ("Don't remove default attributes.")]
193 public override void RemoveAll ()
195 // Remove the child nodes.
198 // Remove all attributes.
199 attributes.RemoveAll ();
203 public virtual void RemoveAllAttributes ()
205 throw new NotImplementedException ();
209 public virtual void RemoveAttribute (string name)
211 throw new NotImplementedException ();
215 public virtual void RemoveAttribute (string localName, string namespaceURI)
217 throw new NotImplementedException ();
221 public virtual XmlNode RemoveAttributeAt (int i)
223 throw new NotImplementedException ();
227 public virtual XmlAttribute RemoveAttributeNode (XmlAttribute oldAttr)
229 throw new NotImplementedException ();
233 public virtual XmlAttribute RemoveAttributeNode (string localName, string namespaceURI)
235 throw new NotImplementedException ();
239 public virtual void SetAttribute (string name, string value)
241 XmlAttribute attribute = OwnerDocument.CreateAttribute (name);
242 attribute.SetOwnerElement (this);
243 attribute.Value = value;
244 Attributes.SetNamedItem (attribute);
248 public virtual void SetAttribute (string localName, string namespaceURI, string value)
250 throw new NotImplementedException ();
254 public virtual XmlAttribute SetAttributeNode (XmlAttribute newAttr)
256 throw new NotImplementedException ();
260 public virtual XmlAttribute SetAttributeNode (string localName, string namespaceURI)
262 throw new NotImplementedException ();
266 public override void WriteContentTo (XmlWriter w)
268 throw new NotImplementedException ();
272 public override void WriteTo (XmlWriter w)
274 throw new NotImplementedException ();