internal 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());
}
if (!attributeDecls.TryGetValue(qname, out attdef) && targetNamespaces.ContainsKey(qname.Namespace))
{
throw new XmlSchemaException(Res.Sch_UndeclaredAttribute, qname.ToString());
}
}
}
return(attdef);
}