[Mono-bugs] [Bug 53018][Nor] New - XmlArrayAttribute.IsNullable does not work.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 18 Jan 2004 07:26:23 -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 erezl@mainsoft.com.

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

--- shadow/53018	2004-01-18 07:26:23.000000000 -0500
+++ shadow/53018.tmp.30784	2004-01-18 07:26:23.000000000 -0500
@@ -0,0 +1,72 @@
+Bug#: 53018
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: erezl@mainsoft.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Summary: XmlArrayAttribute.IsNullable does not work.
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+XmlArrayAttribute.IsNullable is always treated as false, regardless of 
+its actual value.
+
+Steps to reproduce the problem:
+1. Copile and run the following code sample:
+public class arrayTest1
+{
+	[XmlArray (IsNullable = true)]
+	public string [] IsNullableIsTrueArray;
+
+	[XmlArray (IsNullable = false)]
+	public string [] IsNullableIsFalseArray;
+
+	public string [] IsNullableIsNotSetArray;
+}
+public class Test
+{
+	static void Main(string[] args)
+	{
+        	XmlSerializer serializer = new XmlSerializer(typeof
+(arrayTest1));
+                object o = new arrayTest1();
+		System.IO.StreamWriter sout = new System.IO.StreamWriter
+(@"../../" + o.GetType().ToString() + ".xml");
+		serializer.Serialize(sout, o);
+		sout.Close();
+	}
+}
+
+Actual Results:
+In MONO all three members (IsNullableIsTrueArray, IsNullableIsFalseArray, 
+IsNullableNotSetArray) does not appear at all in the serialized object.
+the output Xml file is:
+<?xml version="1.0" encoding="utf-8" ?> 
+<arrayTest1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+xmlns:xsd="http://www.w3.org/2001/XMLSchema" /> 
+
+Expected Results:
+In .NET IsNullableIsFalseArray & IsNullableNotSetArray does not appear in 
+the serialized object, where as IsNullableIsTrueArray appear with the 
+xsi:nil="true" attribute as expected:
+The ouptu xml file is:
+<?xml version="1.0" encoding="utf-8" ?> 
+<arrayTest1 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <IsNullableIsTrueArray xsi:nil="true" /> 
+</arrayTest1>
+
+How often does this happen? 
+always.
+
+Additional Information: