[Mono-bugs] [Bug 56169][Nor] New - XmlDocument doesn't get serialized
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 29 Mar 2004 14:06:34 -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 dpecos_listas@yahoo.es.
http://bugzilla.ximian.com/show_bug.cgi?id=56169
--- shadow/56169 2004-03-29 14:06:34.000000000 -0500
+++ shadow/56169.tmp.27154 2004-03-29 14:06:34.000000000 -0500
@@ -0,0 +1,77 @@
+Bug#: 56169
+Product: Mono: Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: dpecos_listas@yahoo.es
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: XmlDocument doesn't get serialized
+
+Description of Problem:
+
+Following code doesn't work with mono (on .net 1.1 works fine):
+
+using System;
+using System.IO;
+using System.Text;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+
+namespace porbe {
+
+ public class cClass {
+ public XmlDocument xml;
+ }
+
+ public class entry {
+ static void Main () {
+
+ XmlDocument x = new XmlDocument ();
+ x.AppendChild (x.CreateElement ("probe"));
+
+ cClass cc = new cClass ();
+ cc.xml = x;
+
+ StringWriter sw = new StringWriter ();
+ XmlTextWriter jxw = new XmlTextWriter (sw);
+ XmlSerializer xser;
+ xser = new XmlSerializer (typeof (cClass));
+
+ xser.Serialize (jxw, cc);
+ Console.WriteLine ( sw.ToString ());
+ }
+ }
+}
+
+Actual Results:
+
+Unhandled Exception: System.NullReferenceException: A null value was found
+where an object instance was required.
+in <0x0021d>
+System.Xml.Serialization.XmlReflectionImporter:ImportTypeMapping
+(System.Type,System.Xml.Serialization.XmlRootAttribute,string)
+in <0x00162>
+System.Xml.Serialization.XmlReflectionImporter:ImportElementInfo
+(string,string,System.Type,System.Xml.Serialization.XmlTypeMapMemberElement,System.Xml.Serialization.XmlAttributes)
+in <0x00c3d> System.Xml.Serialization.XmlReflectionImporter:CreateMapMember
+(System.Xml.Serialization.XmlReflectionMember,string)
+in <0x00288>
+System.Xml.Serialization.XmlReflectionImporter:ImportClassMapping
+(System.Type,System.Xml.Serialization.XmlRootAttribute,string)
+in <0x0010a>
+System.Xml.Serialization.XmlReflectionImporter:ImportTypeMapping
+(System.Type,System.Xml.Serialization.XmlRootAttribute,string)
+in <0x000f1> System.Xml.Serialization.XmlSerializer:.ctor
+(System.Type,System.Xml.Serialization.XmlAttributeOverrides,System.Type[],System.Xml.Serialization.XmlRootAttribute,string)
+in <0x00021> System.Xml.Serialization.XmlSerializer:.ctor (System.Type)
+in <0x000e9> porbe.entry:Main ()