public static XmlSchemaObject FindAttributeDeclaration(string ns, XmlSchemaSet schemas, XmlSchemaComplexType cType, XmlQualifiedName qname) { XmlSchemaObject xmlSchemaObject = cType.AttributeUses[qname]; if (xmlSchemaObject != null) { return(xmlSchemaObject); } if (cType.AttributeWildcard == null) { return(null); } if (!XmlSchemaUtil.AttributeWildcardItemValid(cType.AttributeWildcard, qname, ns)) { return(null); } if (cType.AttributeWildcard.ResolvedProcessContents == XmlSchemaContentProcessing.Skip) { return(cType.AttributeWildcard); } XmlSchemaAttribute xmlSchemaAttribute = schemas.GlobalAttributes[qname] as XmlSchemaAttribute; if (xmlSchemaAttribute != null) { return(xmlSchemaAttribute); } if (cType.AttributeWildcard.ResolvedProcessContents == XmlSchemaContentProcessing.Lax) { return(cType.AttributeWildcard); } return(null); }