Переглянути джерело

2003-10-13 Atsushi Enomoto <[email protected]>

	* XmlAttribute.cs : Fixed InnerText that did not removed its content
	  if there is two or more children.
	* XmlNode.cs : XmlNode.cs : Fixed bugzilla #49580 (1)to return "",
	  (2)not to compare NodeType for detached nodes, (3)optimization to
	  compare element's prefix.
	* XmlSecureResolver.cs : Removed extraneous members.

svn path=/trunk/mcs/; revision=18948
Atsushi Eno 22 роки тому
батько
коміт
b9afb3f024

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

@@ -1,3 +1,12 @@
+2003-10-13  Atsushi Enomoto <[email protected]>
+
+	* XmlAttribute.cs : Fixed InnerText that did not removed its content
+	  if there is two or more children.
+	* XmlNode.cs : XmlNode.cs : Fixed bugzilla #49580 (1)to return "",
+	  (2)not to compare NodeType for detached nodes, (3)optimization to
+	  compare element's prefix.
+	* XmlSecureResolver.cs : Removed extraneous members.
+
 2003-10-09  Atsushi Enomoto <[email protected]>
 
 	* Added DTDReader.cs. It is almost importation of XmlTextReader.

+ 4 - 0
mcs/class/System.XML/System.Xml/XmlAttribute.cs

@@ -188,6 +188,10 @@ namespace System.Xml
 				XmlNode firstChild = FirstChild;
 				if (firstChild == null)
 					AppendChild (OwnerDocument.CreateTextNode (value));
+				else if (FirstChild.NextSibling != null) {
+					this.RemoveAll ();
+					AppendChild (OwnerDocument.CreateTextNode (value));
+				}
 				else
 					firstChild.Value = value;
 			}

+ 7 - 3
mcs/class/System.XML/System.Xml/XmlNode.cs

@@ -272,6 +272,8 @@ namespace System.Xml
 			switch (NodeType) {
 			case XmlNodeType.Attribute:
 				node = ((XmlAttribute) this).OwnerElement;
+				if (node == null)
+					return String.Empty;
 				break;
 			case XmlNodeType.Element:
 				node = this;
@@ -281,7 +283,9 @@ namespace System.Xml
 				break;
 			}
 
-			while (node.NodeType != XmlNodeType.Document) {
+			while (node != null) {
+				if (node.Prefix == prefix)
+					return node.NamespaceURI;
 				foreach (XmlAttribute attr in node.Attributes) {
 					if (prefix == attr.LocalName && attr.Prefix == "xmlns"
 						|| attr.Name == "xmlns" && prefix == String.Empty)
@@ -289,7 +293,7 @@ namespace System.Xml
 				}
 				node = node.ParentNode;
 			}
-			return null;
+			return String.Empty;
 		}
 
 		public virtual string GetPrefixOfNamespace (string namespaceURI)
@@ -625,7 +629,7 @@ namespace System.Xml
 			return SelectSingleNode (xpath, null);
 		}
 
-		[MonoTODO]
+		[MonoTODO ("return node in document order")]
 		public XmlNode SelectSingleNode (string xpath, XmlNamespaceManager nsmgr)
 		{
 			XPathNavigator nav = CreateNavigator ();

+ 0 - 12
mcs/class/System.XML/System.Xml/XmlSecureResolver.cs

@@ -52,12 +52,6 @@ namespace System.Xml
 
 			return e;
 		}
-
-		[MonoTODO]
-		public static new bool Equals (object objA, object objB)
-		{
-			throw new NotImplementedException ();
-		}
 #endregion
 
 		XmlResolver resolver;
@@ -86,12 +80,6 @@ namespace System.Xml
 			: this (resolver, CreateEvidenceForUrl (securityUrl))
 		{
 		}
-
-		[MonoTODO]
-		~XmlSecureResolver ()
-		{
-			// What is expected here, not in Dispose() ?
-		}
 #endregion
 
 #region Property