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



The information in this article applies to:

  • Microsoft XML 2.0
  • Microsoft XML 3.0
  • Microsoft XML 4.0

This article was previously published under Q262585

SYMPTOMS

If you use the "xml" keyword (in any combination of uppercase or lowercase letters) in user-defined namespace prefixes in an XML document, the Microsoft XML (MSXML) parser generates the following error message:
The namespace prefix is not allowed to start with the reserved string "xml."

CAUSE

The xml keyword in any combination of uppercase or lowercase letters is a reserved word, and therefore cannot be specified as the first three characters of a user-defined namespace prefix.

RESOLUTION

Rename the namespace prefix so that it does not begin with the xml keyword.

STATUS

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

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open a new file in Microsoft Notepad.
  2. Cut and paste the following XML code into Notepad:
    <?xml version="1.0"?>
    <Books xmlns:xmldt="My-Namespace">
       <Book>
          <xmldt:Title></xmldt:Title>
          <xmldt:ISBN></xmldt:ISBN>
       </Book>
    </Books>
    					
  3. Save the file as an XML file on your hard drive.
  4. Open the saved XML file in Internet Explorer, and note that the MSXML parser generates the error message in the "Symptoms" section of this article.
  5. Change the case of the xml keyword (uppercase and mixedcase) in the prefix name, and then save and open the XML file in Internet Explorer. Note that the same error message appears.
  6. Rename the namespace prefix so that it does not begin with the xml keyword. Save and open the XML file in Internet Explorer, and note the MSXML parser successfully loads the document in Internet Explorer and displays it by applying the default Extensible Stylesheet Language (XSL) stylesheet.

Modification Type:MajorLast Reviewed:8/8/2003
Keywords:kbprb KB262585