touchups on XmlTextWriter attribute writing.
[mono.git] / mcs / class / System.XML / System.Xml / XmlAttribute.cs
index 147ba95f150eab0157d480ed5364d8566484283e..0db650d74b0272bb1927b2bc25ee97a07c315dda 100644 (file)
@@ -146,10 +146,18 @@ namespace System.Xml
 
                #region Methods
 
-               [MonoTODO]
                public override XmlNode CloneNode (bool deep)
                {
-                       throw new NotImplementedException ();
+                       XmlNode node = new XmlAttribute (prefix, localName, namespaceURI,
+                                                        OwnerDocument);
+                       if (deep) {
+                               while ((node != null) && (node.HasChildNodes)) {
+                                       AppendChild (node.NextSibling.CloneNode (true));
+                                       node = node.NextSibling;
+                               }
+                       }
+
+                       return node;
                }
 
                internal void SetOwnerElement (XmlElement ownerElement)
@@ -158,13 +166,13 @@ namespace System.Xml
                }
 
                [MonoTODO]
-               public override void WriteContentTo(XmlWriter w)
+               public override void WriteContentTo (XmlWriter w)
                {
                        throw new NotImplementedException ();
                }
 
                [MonoTODO]
-               public override void WriteTo(XmlWriter w)
+               public override void WriteTo (XmlWriter w)
                {
                        throw new NotImplementedException ();
                }
@@ -172,13 +180,9 @@ namespace System.Xml
                #endregion
 
                internal override XmlLinkedNode LastLinkedChild {
-                       get     {
-                               return lastChild;
-                       }
+                       get { return lastChild; }
 
-                       set {
-                               lastChild = value;
-                       }
+                       set { lastChild = value; }
                }
        }
 }