Article ID: 292038 - Last Review: October 16, 2002 - Revision: 1.4

FIX: Duplicate Attributes in XML when DTD Has Attributes with Default Values

This article was previously published under Q292038

On This Page

Expand all | Collapse all

SYMPTOMS

When a document type definition (DTD) has attributes with default values, the resulting XML file contains duplicate attributes.

STATUS

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

This bug was corrected in Microsoft XML 3.0 Service Pack 1.

For additional information on other fixes included in Microsoft XML 3.0 Service Pack 1, click the article number below to view the article in the Microsoft Knowledge Base:
292935  (http://support.microsoft.com/kb/292935/EN-US/ ) INFO: List of Issues Fixed in Microsoft XML 3.0 Service Pack 1
For the latest information and downloads of MSXML, refer to the following MSDN Web site at:
http://msdn.microsoft.com/xml/default.asp (http://msdn.microsoft.com/xml/default.asp)

MORE INFORMATION

Steps to Reproduce Behavior

  1. Paste the following code in a new text document, and save the file as Repro.dtd:
    <!ELEMENT root (tag)>
    <!ELEMENT tag EMPTY>
    <!ATTLIST tag
    attr1 (value11|value12) "value11"
    attr2 (value21|value22) "value22"
    >
    					
  2. Paste the following text in another new document, and save the file as Repro.xml in the same location as the DTD file you just created:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE root SYSTEM "repro.dtd" >
    <root>
      <tag attr2="value21"/>
    </root>
    					
  3. Using Microsoft Internet Explorer, browse to Repro.xml.
The following is the expected result:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
  <!DOCTYPE root (View Source for full doctype...)> 
- <root>
  <tag attr2="value21" attr1="value11" /> 
  </root>
				
However, the actual result is as follows:
<?xml version="1.0" encoding="ISO-8859-1" ?> 
  <!DOCTYPE root (View Source for full doctype...)> 
- <root>
  <tag attr2="value21" attr1="value11" attr2="value22" /> 
  </root>
				

APPLIES TO
  • Microsoft XML Parser 3.0
Keywords: 
kbbug kbfix kbmsxml300sp1fix kbmsxmlnosweep KB292038
 

Article Translations