internal override int Validate(ValidationEventHandler h, XmlSchema schema) { if (base.IsValidated(schema.CompilationId)) { return(this.errorCount); } if (!this.parentIsGroupDefinition && base.ValidatedMaxOccurs != 1m) { base.error(h, "-all- group is limited to be content of a model group, or that of a complex type with maxOccurs to be 1."); } base.CompiledItems.Clear(); foreach (XmlSchemaObject xmlSchemaObject in this.Items) { XmlSchemaParticle xmlSchemaParticle = (XmlSchemaParticle)xmlSchemaObject; this.errorCount += xmlSchemaParticle.Validate(h, schema); if (xmlSchemaParticle.ValidatedMaxOccurs != 0m && xmlSchemaParticle.ValidatedMaxOccurs != 1m) { base.error(h, "MaxOccurs of a particle inside -all- compositor must be either 0 or 1."); } base.CompiledItems.Add(xmlSchemaParticle); } this.ComputeEmptiable(); this.ValidationId = schema.ValidationId; return(this.errorCount); }
internal override int Validate(ValidationEventHandler h, XmlSchema schema) { if (base.IsValidated(schema.CompilationId)) { return(this.errorCount); } base.CompiledItems.Clear(); foreach (XmlSchemaObject xmlSchemaObject in this.Items) { XmlSchemaParticle xmlSchemaParticle = (XmlSchemaParticle)xmlSchemaObject; this.errorCount += xmlSchemaParticle.Validate(h, schema); base.CompiledItems.Add(xmlSchemaParticle); } this.ValidationId = schema.ValidationId; return(this.errorCount); }