public SchemaAttDef GetAttributeXdr(SchemaElementDecl ed, XmlQualifiedName qname) {
SchemaAttDef attdef = null;
if (ed != null) {
attdef = ed.GetAttDef(qname);;
if (attdef == null) {
if (!ed.ContentValidator.IsOpen || qname.Namespace.Length == 0) {
throw new XmlSchemaException(Res.Sch_UndeclaredAttribute, qname.ToString());
}
attdef = (SchemaAttDef)attributeDecls[qname];
if (attdef == null && targetNamespaces.Contains(qname.Namespace)) {
throw new XmlSchemaException(Res.Sch_UndeclaredAttribute, qname.ToString());
}
}
}
return attdef;
}