internal override XmlNameSemantics?TryXmlSemantics()
            {
                var xmlSemantics = XmlNameSemantics.FromName(_name);

                if (xmlSemantics.Prefix != null)
                {
                    return(xmlSemantics);
                }
                return(null);
            }
Exemple #2
0
        private bool TryExtractXmlnsPrefixMapping(DomAttribute a, out string prefix)
        {
            // xmlns attributes are never mapped to QNames, so we can assert directly
            // on the format of the attribute

            // TODO This could be re-entrant due to a.LocalName referencing
            // DomName => XmlNameContext => this resolver

            var xml = XmlNameSemantics.FromName(a.LocalName);

            if (xml.Prefix == "xmlns")
            {
                prefix = xml.LocalName;
                return(true);
            }
            prefix = null;
            return(false);
        }