Ver Fonte

2005-12-23 Atsushi Enomoto <[email protected]>

	* XmlTextWriter.cs : (WriteStartAttribute) set prefix as "xmlns" when
	  namespaceURI is that of xmlns attributes.

	* XmlTextWriterTests.cs : XmlNs_Valid2() is working now.


svn path=/trunk/mcs/; revision=54792
Atsushi Eno há 20 anos atrás
pai
commit
a2f89ee36f

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

@@ -1,3 +1,8 @@
+2005-12-23  Atsushi Enomoto <[email protected]>
+
+	* XmlTextWriter.cs : (WriteStartAttribute) set prefix as "xmlns" when
+	  namespaceURI is that of xmlns attributes.
+
 2005-12-15  Atsushi Enomoto <[email protected]>
 
 	* DTDObjectModel.cs : (CreateXsdParticle) element particle was

+ 3 - 0
mcs/class/System.XML/System.Xml/XmlTextWriter.cs

@@ -777,6 +777,9 @@ openElements [openElementCount - 1]).IndentingOverriden;
 #endif
 				throw ArgumentError (String.Format ("The 'xmlns' attribute is bound to the reserved namespace '{0}'", XmlnsNamespace));
 
+			if (ns == XmlnsNamespace) // see bug #77083
+				prefix = localName == "xmlns" ? String.Empty : "xmlns";
+
 			CheckState ();
 
 			if (ws == WriteState.Content)

+ 4 - 0
mcs/class/System.XML/Test/System.Xml/ChangeLog

@@ -1,3 +1,7 @@
+2005-12-23  Atsushi Enomoto <[email protected]>
+
+	* XmlTextWriterTests.cs : XmlNs_Valid2() is working now.
+
 2005-12-23  Gert Driesen <[email protected]>
 
 	* XmlTextWriterTests.cs: Fixed line endings. Enabled XmlPrefix_ValidMS

+ 1 - 2
mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs

@@ -82,8 +82,7 @@ namespace MonoTests.System.Xml
 			Assert.AreEqual ("xmlns='http://abc.def'", StringWriterText, "#2");
 		}
 
-		[Test]
-		[Category ("NotWorking")] // bug #77083
+		[Test] // bug #77083
 		public void XmlNs_Valid2 ()
 		{
 			xtw.WriteAttributeString (null, "test", "http://www.w3.org/2000/xmlns/", "http://abc.def");