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



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 4.0
  • Microsoft Internet Explorer (Programming) 4.01
  • Microsoft Internet Explorer (Programming) 4.01 SP1
  • Microsoft Internet Explorer (Programming) 4.01 SP2
  • Microsoft Internet Explorer (Programming) 5
  • Microsoft Internet Explorer (Programming) 5.5
  • Microsoft XML 2.0
  • Microsoft XML 2.5
  • Microsoft XML 2.6
  • Microsoft XML 3.0
  • Microsoft XML 4.0

This article was previously published under Q223337

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:

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

REFERENCES

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

Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbFAQ kbinfo KB223337