Partager via


responseXML Property (IXMLHTTPRequest)

 

Represents the parsed response entity body.

Script Syntax

var objDispatch = oXMLHttpRequest.responseXML;  

Example

var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
xmlhttp.open("GET", "https://localhost/books.xml", false);
xmlhttp.send();
WScript.Echo(xmlhttp.responseXML.xml);

Visual Basic Syntax

Set objDispatch = oXMLHttpRequest.responseXML  

C/C++ Syntax

HRESULT get_responseXML(IDispatch** ppBody);  

Parameters

ppBody[out, retval]
The response entity body as an XML document.

C/C++ Return Values

S_OK
The value returned if successful.

E_PENDING
The value returned if the data is unavailable.

Remarks

The property is read-only. For security reasons, the parser validation features are always turned off to prevent Microsoft® XML Core Services (MSXML) from attempting to download a document type definition (DTD) or XML-Data definition. If the response entity body is not valid XML, this property returns DOMDocument that was parsed so that you can access the error. This property does not return IXMLDOMParseError itself, but it is accessible from DOMDocument.

If the response was generated by an Active Server Pages (ASP) page and the Multipurpose Internet Mail Extension (MIME) type was not correctly set to one of the supported MIME types using the ASP method Response.ContentType then responseXML will be empty.

The supported MIME types for MSXML 6.0 are: "text/xml", "application/xml" or anything that ends with "+xml", for example "application/rss+xml".

The supported MIME types for MSXML 3.0 are: "text/xml" and "application/xml".

Versioning

Implemented in: MSXML 3.0, MSXML 6.0

Applies to

IXMLHTTPRequest

See Also

IXMLDOMDocument-DOMDocument
IXMLDOMParseError
responseBody Property (IXMLHTTPRequest)
responseStream Property (IXMLHTTPRequest)
responseText Property (IXMLHTTPRequest)