Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2007-11-01 14:38:14 +0300
committerAtsushi Eno <atsushieno@gmail.com>2007-11-01 14:38:14 +0300
commitd9b24722e27c184c6f08eca30f9486402443c843 (patch)
tree4eb0144d8bd749b7f934e7a0712a669acc69c65b /mcs/class/System.XML/System.Xml.Serialization
parentc67dc1e1713432470af2fcb6f5cac8e8d1418f8a (diff)
2007-11-01 Atsushi Enomoto <atsushi@ximian.com>
* XmlSchemaImporter.cs : simpleType is allowed to be imported. (Part of #336739 fix.) * XmlSchemaImporterTests.cs : test for importing simple-typed top-level element. svn path=/trunk/mcs/; revision=88636
Diffstat (limited to 'mcs/class/System.XML/System.Xml.Serialization')
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/ChangeLog5
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs7
2 files changed, 10 insertions, 2 deletions
diff --git a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
index 82e5a1772f3..075baafe763 100644
--- a/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
+++ b/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-01 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlSchemaImporter.cs : simpleType is allowed to be imported.
+ (Part of #336739 fix.)
+
2007-10-30 Atsushi Enomoto <atsushi@ximian.com>
* XmlCustomFormatter.cs : use RoundtripKind when converting to and
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
index 36380236b2d..25971d06c03 100644
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
+++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
@@ -467,6 +467,9 @@ namespace System.Xml.Serialization
XmlTypeMapping map = GetRegisteredTypeMapping (qname);
if (map != null) return map;
+ if (stype is XmlSchemaSimpleType)
+ return ImportClassSimpleType (stype.QualifiedName, (XmlSchemaSimpleType) stype, name);
+
map = CreateTypeMapping (qname, SchemaTypes.Class, name);
map.Documentation = GetDocumentation (stype);
map.IsNullable = elem.IsNillable;
@@ -522,7 +525,7 @@ namespace System.Xml.Serialization
throw new InvalidOperationException ("Cannot import schema for type '" + elem.SchemaTypeName.Name + "' from namespace '" + elem.SchemaTypeName.Namespace + "'. Redefine not supported");
}
- if (stype is XmlSchemaSimpleType) return false;
+ //if (stype is XmlSchemaSimpleType) return false;
return true;
}
@@ -1319,7 +1322,7 @@ namespace System.Xml.Serialization
// Create an enum map
CodeIdentifiers codeIdents = new CodeIdentifiers ();
- XmlTypeMapping enumMap = CreateTypeMapping (typeQName, SchemaTypes.Enum, null);
+ XmlTypeMapping enumMap = CreateTypeMapping (typeQName, SchemaTypes.Enum, root);
enumMap.Documentation = GetDocumentation (stype);
bool isFlags = false;