Author: atsushi
Date: 2005-07-14 12:49:36 -0400 (Thu, 14 Jul 2005)
New Revision: 47312

Modified:
   trunk/mcs/class/System.XML/System.Xml/ChangeLog
   trunk/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
   trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog
   trunk/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs
Log:
2005-07-14  Atsushi Enomoto <[EMAIL PROTECTED]>

        * XmlTextWriter.cs : In WriteQualifiedName(), when there is open
          attribute, it calls LookupPrefix() and then if namespace was empty,
          it resulted in an exception. Fixed bug #75546.

        * XmlTextWriterTests.cs : added bug #75546 testcase.



Modified: trunk/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/ChangeLog     2005-07-14 16:46:43 UTC 
(rev 47311)
+++ trunk/mcs/class/System.XML/System.Xml/ChangeLog     2005-07-14 16:49:36 UTC 
(rev 47312)
@@ -1,3 +1,9 @@
+2005-07-14  Atsushi Enomoto <[EMAIL PROTECTED]>
+
+       * XmlTextWriter.cs : In WriteQualifiedName(), when there is open
+         attribute, it calls LookupPrefix() and then if namespace was empty,
+         it resulted in an exception. Fixed bug #75546.
+
 2005-06-29  Atsushi Enomoto <[EMAIL PROTECTED]>
 
        * XmlConvert.cs : ToTimeSpan() should accept milliseconds (according

Modified: trunk/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml/XmlTextWriter.cs      2005-07-14 
16:46:43 UTC (rev 47311)
+++ trunk/mcs/class/System.XML/System.Xml/XmlTextWriter.cs      2005-07-14 
16:49:36 UTC (rev 47312)
@@ -713,7 +713,7 @@
                        // WriteQualifiedName internal will reject such
                        // qname whose namespace is not declared.
                        string prefix = null;
-                       if (openAttribute && LookupPrefix (ns) == null) {
+                       if (openAttribute && ns != String.Empty && LookupPrefix 
(ns) == null) {
                                prefix = CheckNewPrefix (true, null, ns);
                                namespaceManager.AddNamespace (prefix, ns);
                        }

Modified: trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog        2005-07-14 
16:46:43 UTC (rev 47311)
+++ trunk/mcs/class/System.XML/Test/System.Xml/ChangeLog        2005-07-14 
16:49:36 UTC (rev 47312)
@@ -1,3 +1,7 @@
+2005-07-14  Atsushi Enomoto <[EMAIL PROTECTED]>
+
+       * XmlTextWriterTests.cs : added bug #75546 testcase.
+
 2005-06-29  Atsushi Enomoto <[EMAIL PROTECTED]>
 
        * XmlConvertTests.cs : added timespan milliseconds testcase.

Modified: trunk/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs
===================================================================
--- trunk/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs    
2005-07-14 16:46:43 UTC (rev 47311)
+++ trunk/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs    
2005-07-14 16:49:36 UTC (rev 47312)
@@ -1386,5 +1386,19 @@
                        xtw.WriteEndElement ();
                        AssertEquals ("<root xml:space='preserve' />", 
sw.ToString ());
                }
+
+               [Test] // bug #75546
+               public void WriteEmptyNSQNameInAttribute ()
+               {
+                       XmlTextWriter xtw = new XmlTextWriter (TextWriter.Null);
+                       xtw.WriteStartElement ("foo", "urn:goo");
+                       xtw.WriteAttributeString ("xmlns:bar", "urn:bar");
+                       xtw.WriteStartAttribute ("foo", "");
+                       xtw.WriteQualifiedName ("n1", "urn:bar");
+                       xtw.WriteEndAttribute ();
+                       xtw.WriteStartAttribute ("foo", "");
+                       xtw.WriteQualifiedName ("n2", "");
+                       xtw.WriteEndAttribute ();
+               }
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to