+2006-09-05 Lluis Sanchez Gual <lluis@novell.com>
+
+ * XmlSchemaImporter.cs: Always import simple type unions
+ as string (like MS.NET does). Fixes bug #79234.
+
2006-08-25 Kornél Pál <kornelpal@gmail.com>
* MapCodeGenerator.cs: Use assembly file version constants.
\r
TypeData FindBuiltInType (XmlQualifiedName qname, XmlSchemaSimpleType st)\r
{\r
- if (CanBeEnum (st))\r
+ if (CanBeEnum (st) && qname != null)\r
return ImportType (qname, null, true).TypeData;\r
\r
if (st.Content is XmlSchemaSimpleTypeRestriction) {\r
else if (st.Content is XmlSchemaSimpleTypeList) {\r
return FindBuiltInType (GetContentBaseType (st.Content)).ListTypeData;\r
}\r
- else if (st.Content is XmlSchemaSimpleTypeUnion)\r
- {\r
- // Check if all types of the union are equal. If not, then will use anyType.\r
- XmlSchemaSimpleTypeUnion uni = (XmlSchemaSimpleTypeUnion) st.Content;\r
- TypeData utype = null;\r
-\r
- // Anonymous types are unique\r
- if (uni.BaseTypes.Count != 0 && uni.MemberTypes.Length != 0)\r
- return FindBuiltInType (anyType);\r
-\r
- foreach (XmlQualifiedName mt in uni.MemberTypes)\r
- {\r
- TypeData qn = FindBuiltInType (mt);\r
- if (utype != null && qn != utype) return FindBuiltInType (anyType);\r
- else utype = qn;\r
- }\r
- return utype;\r
+ else if (st.Content is XmlSchemaSimpleTypeUnion) {\r
+ // MS.NET always import simple unions as string\r
+ return FindBuiltInType (new XmlQualifiedName ("string", XmlSchema.Namespace));\r
}\r
else\r
return null;\r