ParseQNameThrow() static private method

Calls parseQName and throws exception if the resulting name is not a valid QName. Returns the prefix and local name parts.
static private ParseQNameThrow ( string s, string &prefix, string &localName ) : void
s string
prefix string
localName string
return void
Exemplo n.º 1
0
        private void ValidateQName(string name)
        {
            string str;
            string str2;

            ValidateNames.ParseQNameThrow(name, out str, out str2);
        }
        internal static XmlQualifiedName Parse(string s, IXmlNamespaceResolver nsmgr, out string prefix)
        {
            string str;

            ValidateNames.ParseQNameThrow(s, out prefix, out str);
            string ns = nsmgr.LookupNamespace(prefix);

            if (ns == null)
            {
                if (prefix.Length != 0)
                {
                    throw new XmlException("Xml_UnknownNs", prefix);
                }
                ns = string.Empty;
            }
            return(new XmlQualifiedName(str, ns));
        }
Exemplo n.º 3
0
        internal static XmlQualifiedName Parse(string s, IXmlNamespaceResolver nsmgr, out string prefix)
        {
            string localName;

            ValidateNames.ParseQNameThrow(s, out prefix, out localName);

            string uri = nsmgr.LookupNamespace(prefix);

            if (uri == null)
            {
                if (prefix.Length != 0)
                {
                    throw new XmlException(Res.Xml_UnknownNs, prefix);
                }
                else   //Re-map namespace of empty prefix to string.Empty when there is no default namespace declared
                {
                    uri = string.Empty;
                }
            }
            return(new XmlQualifiedName(localName, uri));
        }
Exemplo n.º 4
0
        private void ValidateQName(string name)
        {
            string prefix, localName;

            ValidateNames.ParseQNameThrow(name, out prefix, out localName);
        }
Exemplo n.º 5
0
 private static void ValidateQName(string name)
 {
     ValidateNames.ParseQNameThrow(name);
 }