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);
}
}