System.Xml.XmlDocument.GetSchemaElementDecl C# (CSharp) Method

GetSchemaElementDecl() private method

private GetSchemaElementDecl ( XmlElement elem ) : SchemaElementDecl
elem XmlElement
return System.Xml.Schema.SchemaElementDecl
        private SchemaElementDecl GetSchemaElementDecl(XmlElement elem)
        {
            SchemaInfo schInfo = DtdSchemaInfo;
            if (schInfo != null)
            {
                //build XmlQualifiedName used to identify the element schema declaration
                XmlQualifiedName qname = new XmlQualifiedName(elem.LocalName, schInfo.SchemaType == SchemaType.DTD ? elem.Prefix : elem.NamespaceURI);
                //get the schema info for the element
                SchemaElementDecl elemDecl;
                if (schInfo.ElementDecls.TryGetValue(qname, out elemDecl))
                {
                    return elemDecl;
                }
            }
            return null;
        }