X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.XML%2FSystem.Xml.Schema%2FXmlSchemaComplexType.cs;h=9baea7d906ccbd4e9cc8a79aa2df911a1b7be268;hb=018c4be8c5ef6e23ccd9bf798513a6178631e1ea;hp=871093c01caea9e58641185a10cf8492e341fb90;hpb=7ff8f29ff29fa3f08ef305ac43ef079097323286;p=mono.git diff --git a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs index 871093c01ca..9baea7d906c 100755 --- a/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs +++ b/mcs/class/System.XML/System.Xml.Schema/XmlSchemaComplexType.cs @@ -179,6 +179,27 @@ namespace System.Xml.Schema { get{ return attributeWildcard; } } + +#if NET_2_0 + [XmlIgnore] + // LAMESPEC: This property is based on the premise that + // every particle has a unique name, but actually particles + // can be like: + // + // + // + // + // blah + // + // + // + // + // So with this signature this property can never be correct. + public XmlSchemaObjectTable LocalElements { + get { throw new NotImplementedException (); } + } +#endif + #endregion internal XmlSchemaParticle ValidatableParticle @@ -206,6 +227,17 @@ namespace System.Xml.Schema if (this.IsComplied (schema.CompilationId)) return errorCount; +#if NET_2_0 + if (ContentModel != null) + ContentModel.Parent = this; + if (Particle != null) + Particle.Parent = this; + if (AnyAttribute != null) + AnyAttribute.Parent = this; + foreach (XmlSchemaObject obj in Attributes) + obj.Parent = this; +#endif + ValidatedIsAbstract = isAbstract; if (isRedefinedComponent) { @@ -302,17 +334,13 @@ namespace System.Xml.Schema error(h,"attributes, particles or anyattribute is not allowed if ContentModel is present"); errorCount += contentModel.Compile (h, schema); - XmlQualifiedName baseTypeName = null; XmlSchemaSimpleContent smodel = ContentModel as XmlSchemaSimpleContent; if(smodel != null) { XmlSchemaSimpleContentExtension sscx = smodel.Content as XmlSchemaSimpleContentExtension; - if (sscx != null) - baseTypeName = sscx.BaseTypeName; - else { + if (sscx == null) { XmlSchemaSimpleContentRestriction sscr = smodel.Content as XmlSchemaSimpleContentRestriction; if (sscr != null) { - baseTypeName = sscr.BaseTypeName; if (sscr.BaseType != null) { sscr.BaseType.Compile (h, schema); BaseXmlSchemaTypeInternal = sscr.BaseType; @@ -320,43 +348,11 @@ namespace System.Xml.Schema } } } - else - { - XmlSchemaComplexContent cmodel = (XmlSchemaComplexContent) ContentModel; - XmlSchemaComplexContentExtension sccx = cmodel.Content as XmlSchemaComplexContentExtension; - if (sccx != null) { - baseTypeName = sccx.BaseTypeName; - } - else { - XmlSchemaComplexContentRestriction sccr = (XmlSchemaComplexContentRestriction) cmodel.Content; - if (sccr != null) { - baseTypeName = sccr.BaseTypeName; - } - } - } } else { - if(Particle is XmlSchemaGroupRef) - { - XmlSchemaGroupRef xsgr = (XmlSchemaGroupRef)Particle; - errorCount += xsgr.Compile(h,schema); - } - else if(Particle is XmlSchemaAll) - { - XmlSchemaAll xsa = (XmlSchemaAll)Particle; - errorCount += xsa.Compile(h,schema); - } - else if(Particle is XmlSchemaChoice) - { - XmlSchemaChoice xsc = (XmlSchemaChoice)Particle; - errorCount += xsc.Compile(h,schema); - } - else if(Particle is XmlSchemaSequence) - { - XmlSchemaSequence xss = (XmlSchemaSequence)Particle; - errorCount += xss.Compile(h,schema); - } + if (Particle != null) + errorCount += Particle.Compile (h, schema); if(this.anyAttribute != null) { @@ -739,7 +735,7 @@ namespace System.Xml.Schema // do nothing for particle. } // otherwise, it might be missing sub components. - else if (baseType == null && !schema.IsNamespaceAbsent (BaseSchemaTypeName.Namespace))// && schema.Schemas [baseTypeName.Namespace] != null) + else if (baseType == null && !schema.IsNamespaceAbsent (BaseSchemaTypeName.Namespace)) error (h, "Referenced base schema type " + BaseSchemaTypeName + " was not found in the corresponding schema."); // 3.4.3 Complex Type Definition Representation OK :: 2.