[Mono-bugs] [Bug 51305][Nor] New - Creating an 'xmlns' attribute results in duplicate attribute

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 23 Nov 2003 09:45:36 -0500 (EST)


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 gert.driesen@pandora.be.

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

--- shadow/51305	2003-11-23 09:45:36.000000000 -0500
+++ shadow/51305.tmp.534	2003-11-23 09:45:36.000000000 -0500
@@ -0,0 +1,40 @@
+Bug#: 51305
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: Gentoo 1.4 R8
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Creating an 'xmlns' attribute results in duplicate attribute
+
+Creating an xmlns attribute results in a duplicate attribute being generated.
+
+The following code will result in two 'xmlns' attributes in the generated xml :
+
+XmlDocument doc = new XmlDocument();
+doc.AppendChild(doc.CreateElement("root"));
+                                                                          
+     
+// create 'xmlns' attribute and add it to document
+XmlAttribute attr = doc.CreateAttribute("xmlns");
+attr.Value = "http://none";
+doc.DocumentElement.Attributes.Append(attr);
+                                                                          
+     
+// save xml document
+doc.Save("builddoc.xml");
+
+(full test case is provided as attachment)
+
+this will generate the following invalid xml fragment :
+
+<root xmlns="http://none" xmlns="" />