Пример #1
0
        /// <overloads>
        /// <summary>Checks the <c>localname</c> and <c>nsUri</c> arguments and creates
        /// a new <see cref="QName"/> instance if they are well-formed.</summary>
        /// </overloads>
        /// <exception cref="ArgumentException">Thrown when the arguments are not well-formed.</exception>
        /// <remarks>Relative URIs will be rejected as namespace names since such use
        /// has been deprecated.</remarks>
        /// <param name="localName">Local part of qualified XML name.</param>
        /// <param name="nsUri">Namespace URI of qualified XML name.</param>
        /// <returns>Well-formed <see cref="QName"/> instance.</returns>
        public static QName Checked(string localName, string nsUri)
        {
            XmlChars.CheckNcName(localName);
            Uri uri = new Uri(nsUri);

            return(new QName(localName, nsUri));
        }
Пример #2
0
 /// <param name="localName">Local part of qualified XML name.</param>
 /// <returns>Well-formed <see cref="QName"/> instance with empty namespace.</returns>
 public static QName Checked(string localName)
 {
     XmlChars.CheckNcName(localName);
     return(new QName(localName));
 }