* TypeTranslator.cs: Mapped again anyUri, but now it is mapped to String.
authorLluis Sanchez <lluis@novell.com>
Tue, 20 Apr 2004 16:38:53 +0000 (16:38 -0000)
committerLluis Sanchez <lluis@novell.com>
Tue, 20 Apr 2004 16:38:53 +0000 (16:38 -0000)
* XmlSchemaImporter.cs: If a map was initially imported as a class, but it
  turns out that it is an array, import it again as array. This fixes
  bug #57133.

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

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

index c9165bdb23e25e16882359b6395c610fb7303d01..5e835470f146f3d30ecad2ac154ccc0e9424251c 100755 (executable)
@@ -1,3 +1,10 @@
+2004-04-20  Lluis Sanchez Gual <lluis@ximian.com>
+
+       * TypeTranslator.cs: Mapped again anyUri, but now it is mapped to String.
+       * XmlSchemaImporter.cs: If a map was initially imported as a class, but it
+         turns out that it is an array, import it again as array. This fixes
+         bug #57133.
+
 2004-04-15  Lluis Sanchez Gual <lluis@ximian.com>
 
        * XmlSchemaExporter.cs: When checking if a map has been exported or not,
index 932b2418b4390371884a80ae7a5e8c503945a935..f4e95025a62a4cf08b72562fd1518fc8db6e3e4b 100644 (file)
@@ -83,6 +83,7 @@ namespace System.Xml.Serialization
                        primitiveTypes.Add ("NOTATION", new TypeData (typeof (string), "NOTATION", true));
                        primitiveTypes.Add ("token", new TypeData (typeof (string), "token", true));
                        primitiveTypes.Add ("normalizedString", new TypeData (typeof (string), "normalizedString", true));
+                       primitiveTypes.Add ("anyURI", new TypeData (typeof (string), "anyURI", true));
                }
 
                public static TypeData GetTypeData (Type type)
index 8fa65ee547b5e9aa4d694766bb2cf4f82102f304..76a1eeff557dbaae6dfbfa4a4e861b300f31e30b 100644 (file)
@@ -383,7 +383,14 @@ namespace System.Xml.Serialization {
                XmlTypeMapping ImportType (XmlQualifiedName name, XmlSchemaType stype, XmlQualifiedName root)\r
                {\r
                        XmlTypeMapping map = GetRegisteredTypeMapping (name);\r
-                       if (map != null) return map;\r
+                       if (map != null) {\r
+                               XmlSchemaComplexType ct = stype as XmlSchemaComplexType;\r
+                               if (map.TypeData.SchemaType != SchemaTypes.Class || ct == null || !CanBeArray (name, ct))\r
+                                       return map;\r
+                                       \r
+                               // The map was initially imported as a class, but it turns out that it is an\r
+                               // array. It has to be imported now as array.\r
+                       }\r
                        \r
                        if (stype is XmlSchemaComplexType)\r
                                return ImportClassComplexType (name, (XmlSchemaComplexType) stype, root);\r