Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

INFO: Loading/Saving XML Data Using the Internet Explorer XML Parser


View products that this article applies to.

This article was previously published under Q223337

↑ Back to the top


Summary

This article contains a list of methods supported by the Internet Explorer XML parser (MSXML) available for loading and saving XML data.

↑ Back to the top


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:
221841� 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

↑ Back to the top


References

Please refer to MSXML 3 SDK Download on the MSDN Online Web Workshop.

↑ Back to the top


Keywords: kbfaq, kbinfo, KB223337

↑ Back to the top

Article Info
Article ID : 223337
Revision : 4
Created on : 5/12/2003
Published on : 5/12/2003
Exists online : False
Views : 511