responseXML Property (IXMLHTTPRequest)
Represents the parsed response entity body.
Script Syntax
var objDispatch = oXMLHttpRequest.responseXML;
Example
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.5.0"); xmlhttp.open("GET", "http://localhost/sample.xml", false); xmlhttp.send(); alert(xmlhttp.responseXML.xml);
Visual Basic Syntax
Set objDispatch = oXMLHttpRequest.responseXML
Example
Dim xmlhttp As New Msxml2.XMLHTTP50 xmlhttp.open "GET", "http://localhost/sample.xml", False xmlhttp.send MsgBox xmlhttp.responseXML.xml
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) 5.0 for Microsoft Office 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 "text/xml" using the ASP method Response.ContentType
, responseXML
will be empty.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button in the upper-left corner of the page.
See Also
DOMDocument | IXMLDOMParseError | responseBody Property | responseStream Property | responseText Property
Applies to: IXMLHTTPRequest