Procházet zdrojové kódy

2003-08-14 Atsushi Enomoto <[email protected]>

	* XmlNodeReader.cs : Fixed ReadAttributeValue() that might result in
	  vanishing current node.

svn path=/trunk/mcs/; revision=17332
Atsushi Eno před 22 roky
rodič
revize
70f35c66e6

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

@@ -1,3 +1,8 @@
+2003-08-14  Atsushi Enomoto <[email protected]>
+
+	* XmlNodeReader.cs : Fixed ReadAttributeValue() that might result in
+	  vanishing current node.
+
 2003-08-14  Atsushi Enomoto <[email protected]>
 
 	* DTDValidatingReader.cs : Added SchemaType.

+ 7 - 2
mcs/class/System.XML/System.Xml/XmlNodeReader.cs

@@ -276,7 +276,10 @@ namespace System.Xml
 				if (current == null)
 					return String.Empty;
 
-				return current.Prefix;
+				if (current.NodeType == XmlNodeType.Attribute)
+					return current.Prefix != String.Empty ? current.Prefix : null;
+				else
+					return current.Prefix;
 			}
 		}
 
@@ -781,8 +784,10 @@ namespace System.Xml
 			}
 
 			if (current.NodeType == XmlNodeType.Attribute) {
+				if (current.FirstChild == null)
+					return false;
 				current = current.FirstChild;
-				return current != null;
+				return true;
 			} else if (current.ParentNode.NodeType == XmlNodeType.Attribute) {
 				if (current.NextSibling == null)
 					return false;