예제 #1
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);
        }
예제 #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;
		}