FIX: MSXML Does Not Generate Error When Reserved Namespaces Qualify Elements (262590)



The information in this article applies to:

  • Microsoft XML 2.0

This article was previously published under Q262590

SYMPTOMS

According to the XML specifications, the author of an XML document cannot use the prefix "xml" in any combination of upper or lower case letters. However, the Microsoft XML (MSXML) 2.0 parser does not generate an error when the keyword "xml" (in lower case) is not explicitly declared as a user-defined namespace alias and yet is specified as a namespace prefix.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in the MSXML 2.5 parser. To obtain the latest version of the parser, see the following Microsoft Web site:

MORE INFORMATION

Steps to Reproduce Behavior

  1. In Notepad, create a new text file named Books.xml, and paste the following code:
       <?xml version="1.0"?>
       <Books>
          <Book>
              <xml:Title></xml:Title>
              <xml:ISBN></xml:ISBN>
          </Book>
       </Books>
    					
  2. Save Books.xml in a folder on your hard disk.
  3. Open Books.xml in Microsoft Internet Explorer. Notice that the MSXML parser loads and displays the XML without generating any error to indicate the use of the reserved namespace prefix "xml". The MSXML parser can detect this if the keyword "xml" is defined as a namespace alias in one of the parent tags.For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

    262585 PRB: Do Not Use "xml" Keyword to Begin User-Defined Namespace Prefixes

  4. Change the case of the letters in the prefix "xml". For example, change "x" to "X". The preceding code in the MSXML parser generates the following error message:
    Reference to undeclared namespace prefix: 'Xml'.

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbBug kbDSupport KB262590