diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2007-11-01 14:38:14 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2007-11-01 14:38:14 +0300 |
commit | d9b24722e27c184c6f08eca30f9486402443c843 (patch) | |
tree | 4eb0144d8bd749b7f934e7a0712a669acc69c65b /mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs | |
parent | c67dc1e1713432470af2fcb6f5cac8e8d1418f8a (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/XmlSchemaImporter.cs')
-rw-r--r-- | mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs | 7 |
1 files changed, 5 insertions, 2 deletions
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; |