[Mono-bugs] [Bug 45873][Blo] New - XmlDocument.InnerXml generates invalid Xml

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 6 Jul 2003 04:51:11 -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 jlaban@wanadoo.fr.

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

--- shadow/45873	Sun Jul  6 04:51:11 2003
+++ shadow/45873.tmp.20301	Sun Jul  6 04:51:11 2003
@@ -0,0 +1,48 @@
+Bug#: 45873
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: System.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jlaban@wanadoo.Fr               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlDocument.InnerXml generates invalid Xml
+
+The following code fails whith mono :
+
+using System;
+using System.Xml;
+
+namespace xmlTest
+{
+	class Test
+	{
+		static void Main(string[] args)
+		{
+			XmlDocument doc = new XmlDocument();
+			doc.LoadXml("<a xmlns:dt=\"b\" dt:dt=\"c\"/>");
+			XmlDocument doc2 = new XmlDocument();
+			doc2.LoadXml(doc.InnerXml);
+		}
+	}
+}
+
+The problem lies in the InnerXml property that generates invalid xml. 
+Given the xml document in the above example, ms.net InnerText property 
+outputs the folling string :
+
+<a xmlns:dt="b" dt:dt="c" />
+
+Whereas mono outputs this string :
+
+<a xmlns:dt="b" dt:dt="c" xmlns:dt="b" />
+
+Which is incorrect.