Beispiel #1
0
        internal override int Validate(ValidationEventHandler h, XmlSchema schema)
        {
            if (base.IsValidated(schema.CompilationId))
            {
                return(this.errorCount);
            }
            if (this.redefined == null && this.redefinedObject != null)
            {
                this.redefinedObject.Compile(h, schema);
                this.redefined = (XmlSchemaAttributeGroup)this.redefinedObject;
                this.redefined.Validate(h, schema);
            }
            XmlSchemaObjectCollection xmlSchemaObjectCollection = this.Attributes;

            this.attributeUses = new XmlSchemaObjectTable();
            this.errorCount   += XmlSchemaUtil.ValidateAttributesResolved(this.attributeUses, h, schema, xmlSchemaObjectCollection, this.AnyAttribute, ref this.anyAttributeUse, this.redefined, false);
            this.ValidationId  = schema.ValidationId;
            return(this.errorCount);
        }
Beispiel #2
0
        internal override int Validate(ValidationEventHandler h, XmlSchema schema)
        {
            if (IsValidated(schema.CompilationId))
            {
                return(errorCount);
            }

            if (redefined == null && redefinedObject != null)
            {
                redefinedObject.Compile(h, schema);
                redefined = (XmlSchemaAttributeGroup)redefinedObject;
                redefined.Validate(h, schema);
            }

            XmlSchemaObjectCollection actualAttributes = null;

            /*
             * if (this.redefined != null) {
             *      actualAttributes = new XmlSchemaObjectCollection ();
             *      foreach (XmlSchemaObject obj in Attributes) {
             *              XmlSchemaAttributeGroupRef grp = obj as XmlSchemaAttributeGroupRef;
             *              if (grp != null && grp.QualifiedName == this.QualifiedName)
             *                      actualAttributes.Add (redefined);
             *              else
             *                      actualAttributes.Add (obj);
             *      }
             * }
             * else
             */
            actualAttributes = Attributes;

            attributeUses = new XmlSchemaObjectTable();
            errorCount   += XmlSchemaUtil.ValidateAttributesResolved(attributeUses,
                                                                     h, schema, actualAttributes, AnyAttribute,
                                                                     ref anyAttributeUse, redefined, false);
            ValidationId = schema.ValidationId;
            return(errorCount);
        }