Reformat changes, and add some small debugging information to catch errors
[mono.git] / mcs / class / System.XML / System.Xml.Schema / XmlSchemaComplexContentExtension.cs
index b114602ceca1a729eb0bb7d7081f37013081c3fb..4deced9326aae9df141f9e7ddffc7f74079fd38f 100755 (executable)
@@ -30,11 +30,14 @@ namespace System.Xml.Schema
                        set{ baseTypeName = value; }\r
                }\r
 \r
-               [XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]\r
-               public XmlSchemaAnyAttribute AnyAttribute \r
+               [XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]\r
+               [XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]\r
+               [XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]\r
+               [XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]\r
+               public XmlSchemaParticle Particle\r
                {\r
-                       get{ return any; }\r
-                       set{ any = value;}\r
+                       get{ return  particle; }\r
+                       set{ particle = value; }\r
                }\r
 \r
                [XmlElement("attribute",typeof(XmlSchemaAttribute),Namespace="http://www.w3.org/2001/XMLSchema")]\r
@@ -44,14 +47,11 @@ namespace System.Xml.Schema
                        get{ return attributes; }\r
                }\r
 \r
-               [XmlElement("group",typeof(XmlSchemaGroupRef),Namespace="http://www.w3.org/2001/XMLSchema")]\r
-               [XmlElement("all",typeof(XmlSchemaAll),Namespace="http://www.w3.org/2001/XMLSchema")]\r
-               [XmlElement("choice",typeof(XmlSchemaChoice),Namespace="http://www.w3.org/2001/XMLSchema")]\r
-               [XmlElement("sequence",typeof(XmlSchemaSequence),Namespace="http://www.w3.org/2001/XMLSchema")]\r
-               public XmlSchemaParticle Particle\r
+               [XmlElement("anyAttribute",Namespace="http://www.w3.org/2001/XMLSchema")]\r
+               public XmlSchemaAnyAttribute AnyAttribute \r
                {\r
-                       get{ return  particle; }\r
-                       set{ particle = value; }\r
+                       get{ return any; }\r
+                       set{ any = value;}\r
                }\r
 \r
                /// <remarks>\r
@@ -63,6 +63,8 @@ namespace System.Xml.Schema
                        {\r
                                error(h, "base must be present and a QName");\r
                        }\r
+                       else if(!XmlSchemaUtil.CheckQName(BaseTypeName))\r
+                               error(h,"BaseTypeName is not a valid XmlQualifiedName");\r
                        \r
                        if(this.AnyAttribute != null)\r
                        {\r
@@ -104,9 +106,9 @@ namespace System.Xml.Schema
                                        errorCount += ((XmlSchemaSequence)Particle).Compile(h,info);\r
                                }\r
                        }\r
-                       if(this.Id != null && !XmlSchemaUtil.CheckID(Id))\r
-                               error(h, "id must be a valid ID");\r
                        \r
+                       XmlSchemaUtil.CompileID(Id,this,info.IDCollection,h);\r
+\r
                        return errorCount;\r
                }\r
                \r
@@ -150,13 +152,13 @@ namespace System.Xml.Schema
                                {\r
                                        extension.Id = reader.Value;\r
                                }\r
-                               else if(reader.NamespaceURI == "" || reader.NamespaceURI == XmlSchema.Namespace)\r
+                               else if((reader.NamespaceURI == "" && reader.Name != "xmlns") || reader.NamespaceURI == XmlSchema.Namespace)\r
                                {\r
                                        error(h,reader.Name + " is not a valid attribute for extension",null);\r
                                }\r
                                else\r
                                {\r
-                                       //TODO: Add to Unhandled attributes\r
+                                       XmlSchemaUtil.ReadUnhandledAttribute(reader,extension);\r
                                }\r
                        }\r
                        \r