Exemple #1
0
        internal override int Validate(ValidationEventHandler h, XmlSchema schema)
        {
            if (this.IsValidated(schema.ValidationId))
            {
                return(errorCount);
            }

            // 3.8.6 Model Group Correct :: 2. Circular group disallowed.
            if (Particle != null)               // in case of invalid schema.
            {
                Particle.parentIsGroupDefinition = true;

                try {
                    Particle.CheckRecursion(new Stack(), h, schema);
                } catch (XmlSchemaException ex) {
                    error(h, ex.Message, ex);
                    this.isCircularDefinition = true;
                    return(errorCount);
                }
                errorCount += Particle.Validate(h, schema);

                Particle.ValidateUniqueParticleAttribution(new XmlSchemaObjectTable(),
                                                           new ArrayList(), h, schema);
                Particle.ValidateUniqueTypeAttribution(
                    new XmlSchemaObjectTable(), h, schema);
            }

            this.ValidationId = schema.ValidationId;
            return(errorCount);
        }