[Mono-bugs] [Bug 81539][Nor] New - XmlNode[] is not serialized properly

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun May 6 14:28:16 EDT 2007


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 kostat at mainsoft.com.

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

--- shadow/81539	2007-05-06 14:28:16.000000000 -0400
+++ shadow/81539.tmp.7406	2007-05-06 14:28:16.000000000 -0400
@@ -0,0 +1,60 @@
+Bug#: 81539
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com                            
+ReportedBy: kostat at mainsoft.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlNode[] is not serialized properly
+
+This is a regression introduced in r72448.
+
+The following code:
+
+static XmlNode GetNode () {
+System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument ();
+XmlElement objOut = xmlDoc.CreateElement ("myElement");
+((System.Xml.XmlElement) objOut).InnerText = "1234";
+
+return objOut;
+}
+
+
+static void Main (string [] args) {
+XmlSerializer ser = new XmlSerializer (typeof (XmlNode []));
+
+XmlNode [] pp = new XmlNode [1];
+for (int i = 0; i < pp.Length; i++)
+	pp [i] = GetNode ();
+
+StringBuilder sb = new StringBuilder();
+StringWriter writer = new StringWriter (sb);
+ser.Serialize (writer, pp);
+Console.WriteLine (sb.ToString ());
+}
+
+Should output:
+
+<?xml version="1.0" encoding="utf-16"?>
+<ArrayOfXmlNode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <XmlNode>
+    <myElement>1234</myElement>
+  </XmlNode>
+</ArrayOfXmlNode>
+
+But the output is:
+
+<?xml version="1.0" encoding="utf-16"?>
+<ArrayOfXmlNode>
+  <myElement>1234</myElement>
+</ArrayOfXmlNode>


More information about the mono-bugs mailing list