Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 262590 - Last Review: October 15, 2002 - Revision: 1.2
FIX: MSXML Does Not Generate Error When Reserved Namespaces Qualify Elements
This article was previously published under Q262590
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.
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:
Steps to Reproduce Behavior
- 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>
- Save Books.xml in a folder on your hard disk.
- 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Â
(http://kbalertz.com/Feedback.aspx?kbNumber=262585/EN-US/
)
PRB: Do Not Use "xml" Keyword to Begin User-Defined Namespace Prefixes
- 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'.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate