INFO: Loading/Saving XML Data Using the Internet Explorer XML Parser
ID: Q223337
|
The information in this article applies to:
-
Microsoft Internet Explorer (Programming) versions 4.0, 4.01, 4.01 SP1, 4.01 SP2, 5.0
SUMMARY
This article contains a list of methods supported by the Internet Explorer XML parser (MSXML) available for loading and saving XML data.
MORE INFORMATION
When loading or saving data from MSXML, the default behavior is either synchronous or asynchronous, and code must take this into account. Code that uses an asynchronous call to load the XML data must not access the resulting XML object model until the readyState property of the document is set to "complete." Code that uses a synchronous call can access the XML object model immediately after the load operation.
In the version of MSXML that ships with Internet Explorer 4.01 Service Pack 1 and higher, code that uses any of the asynchronous methods can change them to work asynchronously by setting the async property to true.
For additional information, please see the following article in the Microsoft Knowledge Base:
Q221841 PRB: No Access XML Object Model After Call to XML Parser Load() Method
In the following lists, methods that are asynchronous by default are followed by "ASYNC." All others are synchronous by default.
For the version of MSXML that ships with Internet Explorer 4, the supported methods for loading and saving data are as follows:
- IPersistMoniker::Load() - ASYNC
- IXMLDocument::put_URL() - ASYNC
- IPersistStreamInit::Load()
IPersistStreamInit::Save()
For the version of MSXML that ships with Internet Explorer 5, the supported methods for loading and saving data are as follows:
- IPersistStream::Load()
- IPersistStreamInit::Load()
- IPersistMoniker::Load()
- IPersistStream::Load()
- IPersistStreamInit::Load()
- IPersistMoniker::Load() - ASYNC (if !fFullyAvailable)
- IPersistStream::Save()
- IPersistStreamInit::Save()
- IStream::Read()
- IStream::Write()
- IXMLDOMDocument::load() - ASYNC
- IXMLDOMDocument::loadXML()
- IXMLDOMDocument::save()
- IXMLDOMDocument::get_xml()
- IXMLDocument(2)::put_URL() - ASYNC (obsolete)
IXMLDOMDocument::load() takes a VARIANT parameter as input. The acceptable values for this parameter are as follows:
- SAFEARRAY (VT_ARRAY | VT_UI1) - a byte array of XML data
- IStream pointer (VT_UNKNOWN) - an IStream pointer to a stream containing XML data
- IPersistStream pointer (VT_UNKNOWN) - an IUnknown pointer to an object that exposes an IPersistStream pointer for reading object data from the object in XML format
- IRequest (VT_UNKNOWN) - an IRequest pointer to an ASP Request object that was sent from client with XML data
- BSTR (VT_BSTR or other) - as default, MSXML will attempt to convert any other VARIANT type to a BSTR string
Analogously, IXMLDOMDocument::save() also takes a VARIANT parameter as input. The acceptable values for this parameter are as follows:
- IStream pointer (VT_UNKNOWN) - an IStream pointer to a stream that will accept XML data
- IPersistStream pointer (VT_UNKNOWN) - an IUnknown pointer to an object which exposes an IPersistStream pointer for loading the object data from XML format
- IResponse (VT_UNKNOWN) - an IResponse pointer to an ASP Response object to output the XML data into before sending to the client
- BSTR (VT_BSTR or other) - as default, MSXML will attempt to convert any other VARIANT type to a BSTR string
REFERENCES
Please refer to the XML Document object model documentation on the MSDN Online Web Workshop.
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Jason Strayer, Microsoft Corporation
Additional query words:
Keywords : kbIE400 kbIE401 kbIE401sp1 kbIE401sp2 kbGrpInet kbIE500 kbXML kbDSupport kbIEFAQ
Version : WINDOWS:4.0,4.01,4.01 SP1,4.01 SP2,5.0
Platform : WINDOWS
Issue type : kbinfo