PRB: No Access XML Object Model After Call to XML Parser Load() Method (221841)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 5
- Microsoft XML 2.0
- Microsoft XML 2.5
- Microsoft XML 2.6
- Microsoft XML 3.0
This article was previously published under Q221841 SYMPTOMS
The load() method returns successfully but errors occur when accessing the MSXML Document Object Model. The XML document is valid, well-formed, and it contains no errors.
This behavior may be intermittent and does not occur when loading the XML document from the local file system (file://).
CAUSE
By default, the XML parser loads and parses an XML file asynchronously over HTTP. This means that portions of the document's object model will not be available to code immediately after load returns.
RESOLUTION
To ensure the document is loaded, either:
- Set the async property to false before calling the load() method.
OR
- Write the onreadystatechange event procedure of the DOMDocument object, and check to see if the readystate property is "Complete" prior to accessing the DOM objects (value of 4).
REFERENCES
For additional information about the asynchronous behavior of the Internet Explorer 5.0 XML parser, please see the following
article in the Microsoft Knowledge Base:
223337 Loading/saving XML data using the Internet Explorer XML parser
For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:
Modification Type: | Major | Last Reviewed: | 5/11/2006 |
---|
Keywords: | kbprb KB221841 |
---|
|