[Mono-bugs] [Bug 58096][Wis] New - XmlSerializer emits xmlns:="..." for empty prefix entry in XmlSerializerNamespaces

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 5 May 2004 18:58:19 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by atsushi@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=58096

--- shadow/58096	2004-05-05 18:58:19.000000000 -0400
+++ shadow/58096.tmp.30194	2004-05-05 18:58:19.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 58096
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.XML
+AssignedTo: lluis@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlSerializer emits xmlns:="..." for empty prefix entry in XmlSerializerNamespaces
+
+Currently XmlSerializer does not distinguish empty string prefix to write
+namespace attribute.
+
+--------
+
+using System;
+using System.Xml;
+using System.Xml.Serialization;
+
+public class Test
+{
+        public static void Main ()
+        {
+                Test t = new Test ();
+                t.Namespaces.Add ("", "urn:foo");
+                XmlSerializer ser = new XmlSerializer (typeof (Test));
+                ser.Serialize (Console.Out, t);
+        }
+
+        [XmlNamespaceDeclarations]
+        public XmlSerializerNamespaces Namespaces = new XmlSerializerNamespaces
+();
+}
+
+$ ./xs
+<?xml version="1.0" encoding="shift_jis"?>
+<Test xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+xmlns:xsi="http://www.w3.org/
+2001/XMLSchema-instance" xmlns="urn:foo" />
+
+$ mono xs.exe
+<?xml version="1.0" encoding="utf-8"?>
+<Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xsd="http://ww
+w.w3.org/2001/XMLSchema" xmlns:="urn:foo" />
+How often does this happen? 
+
+(Note that "xmlns:=")