private void PreprocessLocalAttribute(XmlSchemaAttribute attribute) {
if (attribute.Name != null) { // name
ValidateNameAttribute(attribute);
PreprocessAttributeContent(attribute);
attribute.SetQualifiedName(new XmlQualifiedName(attribute.Name, (attribute.Form == XmlSchemaForm.Qualified || (attribute.Form == XmlSchemaForm.None && this.attributeFormDefault == XmlSchemaForm.Qualified)) ? this.targetNamespace : null));
}
else { // ref
PreprocessAnnotation(attribute); //set parent of annotation child of ref
if (attribute.RefName.IsEmpty) {
SendValidationEvent(Res.Sch_AttributeNameRef, "???", attribute);
}
else {
ValidateQNameAttribute(attribute, "ref", attribute.RefName);
}
if (!attribute.SchemaTypeName.IsEmpty ||
attribute.SchemaType != null ||
attribute.Form != XmlSchemaForm.None /*||
attribute.DefaultValue != null ||
attribute.FixedValue != null*/
) {
SendValidationEvent(Res.Sch_InvalidAttributeRef, attribute);
}
attribute.SetQualifiedName(attribute.RefName);
}
ValidateIdAttribute(attribute);
}