Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 263586 - Last Review: October 15, 2002 - Revision: 1.5
FIX: DOCTYPE Subset Omitted in Cloned XML DOM
This article was previously published under Q263586
Cloning an XML Document Object Model (DOM) document that contains a DOCTYPE definition with an internal subset on a computer with version 2.0 of the MSXML parser, returns a DOM document without the internal subset of the DOCTYPE definition.
The MSXML parser, version 2.5 (5.0.2920.0), corrects this problem.
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/en-us/xml/default.aspx
(http://msdn.microsoft.com/en-us/xml/default.aspx)
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>
<head>
<title>Microsoft Knowledge Base Article Q Problem Repro</title>
<xml id=xmlisland>
<!DOCTYPE a [
<!ELEMENT a (#PCDATA)>
<!ATTLIST a
id ID #REQUIRED>
]>
<a id="b"></a>
</xml>
<script for=window event=onload>
var xdoc1 = xmlisland.XMLDocument;
var xdoc2 = xdoc1.cloneNode(true);
xdoc1area.innerText = xdoc1.xml;
xdoc2area.innerText = xdoc2.xml;
</script>
<body>
<h2>Microsoft Knowledge Base Article Q Problem Repro</h2>
<h3>Original Document:</h3>
<textarea id=xdoc1area rows=6 cols=60></textarea>
<h3>Cloned Document:</h3>
<textarea id=xdoc2area rows=6 cols=60></textarea>
</body>
</html>
Browse to the page using a Microsoft Internet Explorer Web browser on a computer with version 2.0 of the MSXML parser. The DOCTYPE definition in the second text area does not include the subset contained in the square brackets ([]) in the original DOCTYPE definition.
APPLIES TO
- Microsoft XML Parser 2.0
- Microsoft XML Parser 3.0
- Microsoft XML Core Services 4.0
| kbbug kbfix kbmsxml250fix kbmsxml400fix KB263586 |
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