Prechádzať zdrojové kódy

implementing XmlElement.SetAttributeNode(localName, namespaceURI) and
implementing XmlAttributeCollection.Append(XmlAttribute)

svn path=/trunk/mcs/; revision=7680

Matt Hunter 23 rokov pred
rodič
commit
07aae53fac

+ 5 - 0
mcs/class/System.XML/System.Xml/ChangeLog

@@ -1,3 +1,8 @@
+2002-09-19  Matt Hunter <[email protected]>
+
+	* XmlElement.cs: Implementing SetAttributeNode(localName,namespaceURI)
+	* XmlAttributeCollection.cs: Implemented Append (XmlAttribute) 
+	  
 2002-09-19  Gonzalo Paniagua Javier <[email protected]>
 
 	* XmlConvert.cs: finished implementation.

+ 4 - 3
mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs

@@ -54,11 +54,12 @@ namespace System.Xml
 			}
 		}
 
-		[MonoTODO]
+		
 		public virtual XmlAttribute Append (XmlAttribute node) 
 		{
-			throw new NotImplementedException ();
-		}
+			XmlNode xmlNode = this.SetNamedItem (node);
+			return node;
+		}	
 
 		[MonoTODO]
 		public void CopyTo (XmlAttribute [] array, int index)

+ 4 - 2
mcs/class/System.XML/System.Xml/XmlElement.cs

@@ -283,10 +283,12 @@ namespace System.Xml
 			return oldAttr != null ? oldAttr as XmlAttribute : null;
 		}
 
-		[MonoTODO]
+		
 		public virtual XmlAttribute SetAttributeNode (string localName, string namespaceURI)
 		{
-			throw new NotImplementedException ();
+			XmlDocument xmlDoc = this.OwnerDocument;
+			XmlAttribute xmlAttribute = new XmlAttribute (String.Empty, localName, namespaceURI, xmlDoc);	
+			return this.attributes.Append (xmlAttribute);
 		}
 
 		public override void WriteContentTo (XmlWriter w)