2006-09-05 Lluis Sanchez Gual <lluis@novell.com>
authorLluis Sanchez <lluis@novell.com>
Wed, 6 Sep 2006 17:52:53 +0000 (17:52 -0000)
committerLluis Sanchez <lluis@novell.com>
Wed, 6 Sep 2006 17:52:53 +0000 (17:52 -0000)
* XmlSchemaImporter.cs: In MS.NET 2.0, simple type arrays are mapped
to strings. Make sure maps returned by ImportClassSimpleType are always
simple type maps. All this fixes bug #77585.

svn path=/trunk/mcs/; revision=65021

mcs/class/System.XML/System.Xml.Serialization/ChangeLog
mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs

index b5c977479a9a5e5cd85980d72e3f119877e073f2..9404931f21b19a711663d1a4f2db6064db5b9ff6 100644 (file)
@@ -1,3 +1,9 @@
+2006-09-05  Lluis Sanchez Gual  <lluis@novell.com> 
+
+       * XmlSchemaImporter.cs: In MS.NET 2.0, simple type arrays are mapped
+       to strings. Make sure maps returned by ImportClassSimpleType are always
+       simple type maps. All this fixes bug #77585.
+
 2006-09-05  Lluis Sanchez Gual  <lluis@novell.com>
 
        * XmlSchemaImporter.cs: Always import simple type unions
index a8d9240c829e910042ecaa820ed9be7defddbc8c..c97fca176e434468cc3d00a720f9f5fa704232f3 100644 (file)
@@ -869,9 +869,13 @@ namespace System.Xml.Serialization
                                                {\r
                                                        // It is a simple list (space separated list).\r
                                                        // Since this is not supported, map as a single item value\r
-                                                       // TODO: improve this\r
                                                        member = new XmlTypeMapMemberElement ();\r
+#if NET_2_0\r
+                                                       // In MS.NET those types are mapped to a string\r
+                                                       typeData = TypeTranslator.GetTypeData(typeof(string));\r
+#else\r
                                                        typeData = typeData.ListItemTypeData;\r
+#endif\r
                                                }\r
                                                else\r
                                                        member = new XmlTypeMapMemberList ();\r
@@ -1296,7 +1300,11 @@ namespace System.Xml.Serialization
                        // It is an extension of a primitive or known type\r
                        \r
                        TypeData typeData = FindBuiltInType (typeQName, stype);\r
-                       return GetTypeMapping (typeData);\r
+                       XmlTypeMapping rmap = GetTypeMapping (typeData);\r
+                       \r
+                       // The resulting map must be a simple type. It needs to be explicitely set for arrays\r
+                       rmap.IsSimpleType = true;\r
+                       return rmap;\r
                }\r
 \r
                bool CanBeEnum (XmlSchemaSimpleType stype)\r