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>2006-09-05 15:42:28 +0400
committerLluis Sanchez <lluis@novell.com>2006-09-05 15:42:28 +0400
commitd502f1f791fc3b14c3bc93dd8487c42514c21625 (patch)
tree2f40e8773035dcb5a107418e30028748701fde0c /mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
parent840eebd391b3042234b5df5907825f2764baeed9 (diff)
svn path=/trunk/mcs/; revision=64926
Diffstat (limited to 'mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs')
-rw-r--r--mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs22
1 files changed, 4 insertions, 18 deletions
diff --git a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
index 8e0df5b58a4..a8d9240c829 100644
--- a/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
+++ b/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
@@ -1154,7 +1154,7 @@ namespace System.Xml.Serialization
TypeData FindBuiltInType (XmlQualifiedName qname, XmlSchemaSimpleType st)
{
- if (CanBeEnum (st))
+ if (CanBeEnum (st) && qname != null)
return ImportType (qname, null, true).TypeData;
if (st.Content is XmlSchemaSimpleTypeRestriction) {
@@ -1168,23 +1168,9 @@ namespace System.Xml.Serialization
else if (st.Content is XmlSchemaSimpleTypeList) {
return FindBuiltInType (GetContentBaseType (st.Content)).ListTypeData;
}
- else if (st.Content is XmlSchemaSimpleTypeUnion)
- {
- // Check if all types of the union are equal. If not, then will use anyType.
- XmlSchemaSimpleTypeUnion uni = (XmlSchemaSimpleTypeUnion) st.Content;
- TypeData utype = null;
-
- // Anonymous types are unique
- if (uni.BaseTypes.Count != 0 && uni.MemberTypes.Length != 0)
- return FindBuiltInType (anyType);
-
- foreach (XmlQualifiedName mt in uni.MemberTypes)
- {
- TypeData qn = FindBuiltInType (mt);
- if (utype != null && qn != utype) return FindBuiltInType (anyType);
- else utype = qn;
- }
- return utype;
+ else if (st.Content is XmlSchemaSimpleTypeUnion) {
+ // MS.NET always import simple unions as string
+ return FindBuiltInType (new XmlQualifiedName ("string", XmlSchema.Namespace));
}
else
return null;