Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 262545 - Last Review: October 15, 2002 - Revision: 1.3
FIX: XML Element Retains Datatype After Datatype Attribute Is Programmatically Removed
This article was previously published under Q262545
The MSXML 2.0 parser retains the datatype of an element even after the datatype attribute (dt:dt) is programmatically removed through the Document Object Model (DOM). This causes validation to occur for the named datatype even after the datatype constraint has been removed.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This problem has been fixed in version 2.5 of the MSXML parser. To download the latest version of the parser, visit
http://msdn.microsoft.com/xml/default.asp
(http://msdn.microsoft.com/xml/default.asp)
.
Steps to Reproduce Behavior
To reproduce this behavior, insert the following code into a new text document and save the document as repro.htm:
<HTML>
<BODY>
<XML id=xmlid>
<A>
<B xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="int">3</B>
</A>
</XML>
<SCRIPT For=window Event=Onload>
alert(xmlid.xml);
xmlid.documentElement.childNodes(0).attributes.removeNamedItem("dt:dt");
alert(xmlid.xml);
xmlid.documentElement.childNodes(0).text = "foot";
</SCRIPT>
</BODY>
</HTML>
Browse to the page using an Internet Explorer Web browser on a computer with version 2.0 of the MSXML parser installed. The following error is generated:
Error: Error parsing 'foot' as int datatype.
| kbbug kbfix kbmsxml250fix KB262545 |
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