loadXML Method (Compact 2013)

3/26/2014

Loads an XML document using the supplied string.

Syntax

boolValue = oXMLDOMDocument.loadXML(bstrXML);
HRESULT loadXML(
  BSTR bstrXML,
  VARIANT_BOOL* isSuccessful
);

Parameters

Script

  • bstrXML
    String containing the XML string to load into this XML document object. This string can contain an entire XML document or a well-formed fragment.

C/C++

  • bstrXML
    [in] XML string to load into this XML document object. This string can contain an entire XML document or a well-formed fragment.
  • isSuccessful
    [out, retval] True if the XML load succeeded. This method returns False and sets the documentElement property of the DOMDocument object to Null if the XML load failed.

Return Value

Script

Boolean. Returns True if the XML load succeeded. Returns False and sets the documentElement property of the DOMDocument to Null if the XML load failed.

C/C++

  • S_OK
    Value returned if successful.
  • S_FALSE
    Value returned if the load fails.
  • E_INVALIDARG
    Value returned if isSuccessful is Null.

Remarks

Calling the load Method or loadXML on an existing document immediately discards the content of the document. The loadXML will work only with UTF-16 or UCS-2 encodings.

This member is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

This method applies to the following interface:

DOMDocument.

Requirements

Header

msxml2.h,
msxml2.idl

See Also

Reference

XML DOM Methods
documentElement Property