System.Xml.Schema.SchemaElementDecl.GetAttDef C# (CSharp) Method

GetAttDef() public method

public GetAttDef ( XmlQualifiedName qname ) : SchemaAttDef
qname System.Xml.XmlQualifiedName
return SchemaAttDef
        public SchemaAttDef GetAttDef(XmlQualifiedName qname) {
            return (SchemaAttDef)attdefs[qname];
        }

Usage Example

        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);
        }
All Usage Examples Of System.Xml.Schema.SchemaElementDecl::GetAttDef