Implementation and tests for XmlAttributeCollection.RemoveAll and XmlElement.RemoveAl...
[mono.git] / mcs / class / System.XML / System.Xml / XmlAttribute.cs
index 0db650d74b0272bb1927b2bc25ee97a07c315dda..70419b6c593c70b7864440412916865ba1eb7f26 100644 (file)
@@ -15,7 +15,6 @@ namespace System.Xml
        {
                #region Fields
 
-               private XmlElement ownerElement;
                private XmlLinkedNode lastChild;
                private string localName;
                private string namespaceURI;
@@ -25,6 +24,7 @@ namespace System.Xml
 
                #region Constructor
 
+               [MonoTODO("need to set namespaceURI if prefix is recognized built-in ones like xmlns")]
                protected internal XmlAttribute (
                        string prefix, 
                        string localName, 
@@ -40,10 +40,9 @@ namespace System.Xml
 
                #region Properties
 
-               [MonoTODO]
                public override string BaseURI {
                        get {
-                               throw new NotImplementedException ();
+                               return OwnerElement.BaseURI;
                        }
                }
 
@@ -58,10 +57,11 @@ namespace System.Xml
                        }
                }
 
-               [MonoTODO]
+               [MonoTODO ("Setter.")]
                public override string InnerXml {
                        get {
-                               throw new NotImplementedException ();
+                               // Not sure why this is an override.  Passing through for now.
+                               return base.InnerXml;
                        }
 
                        set {
@@ -101,7 +101,7 @@ namespace System.Xml
 
                public virtual XmlElement OwnerElement {
                        get {
-                               return ownerElement;
+                               return base.ParentNode as XmlElement;
                        }
                }
 
@@ -112,7 +112,15 @@ namespace System.Xml
                        }
                }
 
+               [MonoTODO]
+               // We gotta do more in the set block here
+               // We need to do the proper tests and throw
+               // the correct Exceptions
                public override string Prefix {
+                       set {
+                               prefix = value;
+                       }
+                       
                        get {
                                return prefix;
                        }
@@ -160,21 +168,14 @@ namespace System.Xml
                        return node;
                }
 
-               internal void SetOwnerElement (XmlElement ownerElement)
-               {
-                       this.ownerElement = ownerElement;
-               }
-
-               [MonoTODO]
                public override void WriteContentTo (XmlWriter w)
                {
-                       throw new NotImplementedException ();
+                       w.WriteString (Value);
                }
 
-               [MonoTODO]
                public override void WriteTo (XmlWriter w)
                {
-                       throw new NotImplementedException ();
+                       w.WriteAttributeString (prefix, localName, namespaceURI, Value);
                }
 
                #endregion