internal override int Validate(ValidationEventHandler h, XmlSchema schema) { if (IsValidated(schema.CompilationId)) { return(errorCount); } // 3.8.6 All Group Limited :: 1. // Beware that this section was corrected: E1-26 of http://www.w3.org/2001/05/xmlschema-errata#Errata1 if (!this.parentIsGroupDefinition && ValidatedMaxOccurs != 1) { error(h, "-all- group is limited to be content of a model group, or that of a complex type with maxOccurs to be 1."); } CompiledItems.Clear(); foreach (XmlSchemaParticle obj in Items) { errorCount += obj.Validate(h, schema); if (obj.ValidatedMaxOccurs != 0 && obj.ValidatedMaxOccurs != 1) { error(h, "MaxOccurs of a particle inside -all- compositor must be either 0 or 1."); } CompiledItems.Add(obj); } ComputeEmptiable(); ValidationId = schema.ValidationId; return(errorCount); }
internal override int Validate(ValidationEventHandler h, XmlSchema schema) { if (IsValidated (schema.CompilationId)) return errorCount; CompiledItems.Clear (); foreach (XmlSchemaParticle p in Items) { errorCount += p.Validate (h, schema); // This is basically extraneous for pointless item, but needed to check validation error. CompiledItems.Add (p); } ValidationId = schema.ValidationId; return errorCount; }
internal override int Validate(ValidationEventHandler h, XmlSchema schema) { if (IsValidated(schema.CompilationId)) { return(errorCount); } CompiledItems.Clear(); foreach (XmlSchemaParticle p in Items) { errorCount += p.Validate(h, schema); // This is basically extraneous for pointless item, but needed to check validation error. // XmlSchemaParticle particleInPoint = p.GetParticleWithoutPointless (); // if (particleInPoint != XmlSchemaParticle.Empty) // CompiledItems.Add (particleInPoint); CompiledItems.Add(p); } ValidationId = schema.ValidationId; return(errorCount); }