[Mono-bugs] [Bug 79496][Min] New - XmlDocument.OuterXml does not retain standalone attribute

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Sep 25 15:36:32 EDT 2006


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 at pandora.be.

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

--- shadow/79496	2006-09-25 15:36:32.000000000 -0400
+++ shadow/79496.tmp.4550	2006-09-25 15:36:32.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 79496
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlDocument.OuterXml does not retain standalone attribute
+
+XmlDocument.OuterXml does not retain the standalone attribute on the XML 
+declaration for XML loaded from, for example, string.
+
+To reproduce, compile and run the following code snippet:
+
+using System;
+using System.IO;
+using System.Xml;
+
+public class Test
+{
+  static void Main ()
+  {
+    StringWriter sw = new StringWriter ();
+    XmlTextWriter xtw = new XmlTextWriter (sw);
+    xtw.WriteStartDocument (true);
+    xtw.WriteStartElement ("person");
+    xtw.WriteEndElement ();
+    xtw.Flush ();
+
+    XmlDocument doc = new XmlDocument ();
+    doc.LoadXml (sw.ToString ());
+    Console.WriteLine (doc.OuterXml);
+  }
+}
+
+Expected result:
+
+<?xml version="1.0" encoding="utf-16" standalone="yes"?><person />
+
+Actual result:
+
+<?xml version="1.0" encoding="utf-16"?><person />


More information about the mono-bugs mailing list