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 XmlLinkedNode lastLinkedChild;
20 private string localName;
21 private string namespaceURI;
22 private string prefix;
28 protected internal XmlElement (
32 XmlDocument doc) : base (doc)
35 this.localName = localName;
36 this.namespaceURI = namespaceURI;
38 attributes = new XmlAttributeCollection (this);
45 public override XmlAttributeCollection Attributes {
51 public virtual bool HasAttributes {
53 return attributes.Count > 0;
58 public override string InnerText {
60 throw new NotImplementedException ();
64 throw new NotImplementedException ();
69 public override string InnerXml {
71 throw new NotImplementedException ();
75 throw new NotImplementedException ();
82 throw new NotImplementedException ();
86 throw new NotImplementedException ();
90 internal override XmlLinkedNode LastLinkedChild {
92 return lastLinkedChild;
96 lastLinkedChild = value;
100 public override string LocalName
107 public override string Name {
109 return prefix != String.Empty ? prefix + ":" + localName : localName;
113 public override string NamespaceURI {
120 public override XmlNode NextSibling {
122 return base.NextSibling;
126 public override XmlNodeType NodeType {
128 return XmlNodeType.Element;
133 public override XmlDocument OwnerDocument {
135 return base.OwnerDocument;
139 public override string Prefix {
150 public override XmlNode CloneNode (bool deep)
152 throw new NotImplementedException ();
156 public virtual string GetAttribute (string name)
158 XmlNode attributeNode = Attributes.GetNamedItem (name);
159 return attributeNode != null ? attributeNode.Value : String.Empty;
163 public virtual string GetAttribute (string localName, string namespaceURI)
165 throw new NotImplementedException ();
169 public virtual XmlAttribute GetAttributeNode (string name)
171 throw new NotImplementedException ();
175 public virtual XmlAttribute GetAttributeNode (string localName, string namespaceURI)
177 throw new NotImplementedException ();
181 public virtual XmlNodeList GetElementsByTagName (string name)
183 throw new NotImplementedException ();
187 public virtual XmlNodeList GetElementsByTagName (string localName, string namespaceURI)
189 throw new NotImplementedException ();
193 public virtual bool HasAttribute (string name)
195 throw new NotImplementedException ();
199 public virtual bool HasAttribute (string localName, string namespaceURI)
201 throw new NotImplementedException ();
204 [MonoTODO ("Don't remove default attributes.")]
205 public override void RemoveAll ()
207 // Remove the child nodes.
210 // Remove all attributes.
211 attributes.RemoveAll ();
215 public virtual void RemoveAllAttributes ()
217 throw new NotImplementedException ();
221 public virtual void RemoveAttribute (string name)
223 throw new NotImplementedException ();
227 public virtual void RemoveAttribute (string localName, string namespaceURI)
229 throw new NotImplementedException ();
233 public virtual XmlNode RemoveAttributeAt (int i)
235 throw new NotImplementedException ();
239 public virtual XmlAttribute RemoveAttributeNode (XmlAttribute oldAttr)
241 throw new NotImplementedException ();
245 public virtual XmlAttribute RemoveAttributeNode (string localName, string namespaceURI)
247 throw new NotImplementedException ();
251 public virtual void SetAttribute (string name, string value)
253 XmlAttribute attribute = OwnerDocument.CreateAttribute (name);
254 attribute.SetOwnerElement (this);
255 attribute.Value = value;
256 Attributes.SetNamedItem (attribute);
260 public virtual void SetAttribute (string localName, string namespaceURI, string value)
262 throw new NotImplementedException ();
266 public virtual XmlAttribute SetAttributeNode (XmlAttribute newAttr)
268 throw new NotImplementedException ();
272 public virtual XmlAttribute SetAttributeNode (string localName, string namespaceURI)
274 throw new NotImplementedException ();
278 public override void WriteContentTo (XmlWriter w)
280 throw new NotImplementedException ();
284 public override void WriteTo (XmlWriter w)
286 throw new NotImplementedException ();