Microsoft Knowledge Base Email Alertz

When you load an XML document into an XML

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 290910 - Last Review: August 12, 2005 - Revision: 2.4

FIX: Default Attribute Value for Nondeclared Elements Does Not Exist in DOM

This article was previously published under Q290910

On This Page

SYMPTOMS

When you load an XML document into an XML DOMDocument object after you set the validateOnParse property to False, the default attributes are not inserted for elements that are not declared explicitly in the document's document type definition (DTD).

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://kbalertz.com/Feedback.aspx?kbNumber=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

Section 3.3 of the World Wide Web Consortium (W3C) specification, located at the following Web site
http://www.w3.org/TR/2000/WD-xml-c14n-20001011#Example-SETags (http://www.w3.org/TR/2000/WD-xml-c14n-20001011#Example-SETags)
indicates that the default attribute of an element should be added even if the binding element is not declared in the DTD.

Steps to Reproduce Behavior

  1. Create the HTML document.
    1. Using Windows Notepad or another text editor, create a new text document.
    2. Paste the following code into the new text document:
      <html>
          <script>
          var xmlDoc = new ActiveXObject("MSXML2.DOMDocument");
          xmlDoc.async = false;
          xmlDoc.validateOnParse = false;
      
          xmlDoc.loadXML("<!DOCTYPE doc [<!ATTLIST doc att CDATA 'default'>]><doc/>");
          alert("Number of attributes = " + xmlDoc.documentElement.attributes.length);
          </script>
      </html>
      						
    3. Save the new text document as C:\InetPub\Wwwroot\Testpage.html.
  2. Browse to the HTML document using Internet Explorer.
The number of attributes is 0 but should be 1, because the default attribute should be added automatically.

APPLIES TO
  • Microsoft XML Parser 2.0
  • Microsoft XML Parser 2.5
  • Microsoft XML Parser 2.6
  • Microsoft XML Parser 3.0
Keywords: 
kbbug kbfix kbmsxml300sp1fix kbmsxmlnosweep KB290910
       

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