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:
authorLluis Sanchez <lluis@novell.com>2005-11-07 15:30:02 +0300
committerLluis Sanchez <lluis@novell.com>2005-11-07 15:30:02 +0300
commitaa0acf396e1e234d407b70d9186450872fe972b2 (patch)
tree2a985fa8d2ba35905fabef63034b63982087ea87 /mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
parent6d7725e5bbd816b491c7dbe8ff5485d7419d38b5 (diff)
2005-11-07 Lluis Sanchez Gual <lluis@novell.com>
* XmlSchemaImporter.cs: Added support for restrictions with embedded simple type definitions. svn path=/trunk/mcs/; revision=52648
Diffstat (limited to 'mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs')
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
index 443c7a17c51..64f7e4f058c 100644
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
+++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
@@ -1132,7 +1132,7 @@ namespace System.Xml.Serialization
if (IsPrimitiveTypeNamespace (qname.Namespace))
return TypeTranslator.GetPrimitiveTypeData (qname.Name);
- throw new InvalidOperationException ("Definition of type " + qname + " not found");
+ throw new InvalidOperationException ("Definition of type '" + qname + "' not found");
}
TypeData FindBuiltInType (XmlQualifiedName qname, XmlSchemaSimpleType st)
@@ -1140,8 +1140,13 @@ namespace System.Xml.Serialization
if (CanBeEnum (st))
return ImportType (qname, null, true).TypeData;
- if (st.Content is XmlSchemaSimpleTypeRestriction) {
- return FindBuiltInType (GetContentBaseType (st.Content));
+ if (st.Content is XmlSchemaSimpleTypeRestriction) {
+ XmlSchemaSimpleTypeRestriction rest = (XmlSchemaSimpleTypeRestriction) st.Content;
+ XmlQualifiedName bn = GetContentBaseType (rest);
+ if (bn == XmlQualifiedName.Empty && rest.BaseType != null)
+ return FindBuiltInType (qname, rest.BaseType);
+ else
+ return FindBuiltInType (bn);
}
else if (st.Content is XmlSchemaSimpleTypeList) {
return FindBuiltInType (GetContentBaseType (st.Content)).ListTypeData;