Author: lluis
Date: 2005-11-07 07:30:02 -0500 (Mon, 07 Nov 2005)
New Revision: 52648

Modified:
   trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
   trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
Log:
2005-11-07  Lluis Sanchez Gual  <[EMAIL PROTECTED]>

        * XmlSchemaImporter.cs: Added support for restrictions with
        embedded simple type definitions. 



Modified: trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog       
2005-11-07 11:42:17 UTC (rev 52647)
+++ trunk/mcs/class/System.XML/System.Xml.Serialization/ChangeLog       
2005-11-07 12:30:02 UTC (rev 52648)
@@ -1,3 +1,8 @@
+2005-11-07  Lluis Sanchez Gual  <[EMAIL PROTECTED]>
+
+       * XmlSchemaImporter.cs: Added support for restrictions with
+       embedded simple type definitions. 
+
 2005-11-04  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * XmlElementAttribute.cs : gimme Order; it fixes 100 or more

Modified: 
trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs
===================================================================
--- trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs    
2005-11-07 11:42:17 UTC (rev 52647)
+++ trunk/mcs/class/System.XML/System.Xml.Serialization/XmlSchemaImporter.cs    
2005-11-07 12:30:02 UTC (rev 52648)
@@ -1132,7 +1132,7 @@
                        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 @@
                        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;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to