FIX: DOCTYPE Subset Omitted in Cloned XML DOM (263586)



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 Q263586

SYMPTOMS

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.

RESOLUTION

The MSXML parser, version 2.5 (5.0.2920.0), corrects this problem.

STATUS

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.

MORE INFORMATION

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.

Modification Type:MajorLast Reviewed:10/15/2002
Keywords:kbBug kbDSupport kbMSXML250fix kbMSXML400fix KB263586