ParseNmtoken() static private method

Attempts to parse the input string as an Nmtoken (see the XML spec production [7] && XML Namespaces spec). Quits parsing when an invalid Nmtoken char is reached or the end of string is reached. Returns the number of valid Nmtoken chars that were parsed.
static private ParseNmtoken ( string s, int offset ) : int
s string
offset int
return int
示例#1
0
        // NOTE: This does not correctly check start name char, but we cannot change it since it would be a breaking change.
        internal static void CheckName(String name)
        {
            int endPos = ValidateNames.ParseNmtoken(name, 0);

            if (endPos < name.Length)
            {
                throw new XmlException(SR.Format(SR.Xml_BadNameChar, XmlExceptionHelper.BuildCharExceptionArgs(name, endPos)));
            }
        }