private void PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent) { for (int i = 0; i < attributes.Count; ++i) { SetParent(attributes[i], parent); XmlSchemaAttribute attribute = attributes[i] as XmlSchemaAttribute; if (attribute != null) { PreprocessLocalAttribute(attribute); } else { // XmlSchemaAttributeGroupRef XmlSchemaAttributeGroupRef attributeGroupRef = (XmlSchemaAttributeGroupRef)attributes[i]; if (attributeGroupRef.RefName.IsEmpty) { SendValidationEvent(Res.Sch_MissAttribute, "ref", attributeGroupRef); } else { ValidateQNameAttribute(attributeGroupRef, "ref", attributeGroupRef.RefName); } PreprocessAnnotation(attributes[i]); //set parent of annotation child of attributeGroupRef ValidateIdAttribute(attributes[i]); } } if (anyAttribute != null) { try { SetParent(anyAttribute, parent); PreprocessAnnotation(anyAttribute); //set parent of annotation child of any attribute anyAttribute.BuildNamespaceListV1Compat(this.targetNamespace); } catch { SendValidationEvent(Res.Sch_InvalidAnyAttribute, anyAttribute); } ValidateIdAttribute(anyAttribute); } }
private void PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent) { foreach (XmlSchemaAnnotated obj in attributes) { SetParent(obj, parent); if (obj is XmlSchemaAttribute) { PreprocessLocalAttribute((XmlSchemaAttribute)obj); } else { // XmlSchemaAttributeGroupRef XmlSchemaAttributeGroupRef attributeGroupRef = (XmlSchemaAttributeGroupRef)obj; if (attributeGroupRef.RefName.IsEmpty) { SendValidationEvent(Res.Sch_MissAttribute, "ref", attributeGroupRef); } else { ValidateQNameAttribute(attributeGroupRef, "ref", attributeGroupRef.RefName); } PreprocessAnnotation(obj); //set parent of annotation child of attributeGroupRef ValidateIdAttribute(obj); } } if (anyAttribute != null) { try { SetParent(anyAttribute, parent); PreprocessAnnotation(anyAttribute); //set parent of annotation child of any attribute anyAttribute.BuildNamespaceListV1Compat(this.targetNamespace); } catch { SendValidationEvent(Res.Sch_InvalidAnyAttribute, anyAttribute); } ValidateIdAttribute(anyAttribute); } }