BUG: URL Property on XMLHTTPRequest's ResponseXML Is Not Set

This article was previously published under Q234460
This article has been archived. It is offered "as is" and will no longer be updated.
When you use the XMLHTTPRequest object to obtain XML data from another server, the responseXML's URL property comes up blank.
If you want to refer to the URL from which the XML is downloaded, keep a variable with the URL parameter that you supplied to XMLHTTPRequest's open() method. In cases in which the original request redirects to another URL, there is no way to discover the value of the "final" URL in the redirection chain.
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Steps to Reproduce Behavior

  1. Save the following XML file as XmlFile.xml on the root folder of your Web server:
    <?xml version="1.0"><parent><child>	<grandchild/></child><child>	<grandchild/></child></parent>					
  2. Save the following HTML file as TestXMLURL.htm on your Web server:
    <html><head><title>XMLHTTPRequest responseXML.url Test</title><SCRIPT>function loadXML() {	var x = new ActiveXObject("Microsoft.XMLHTTP");      //Use the version dependent PROGID       //MSXML2.DOMDocument.4.0 if you wish to create and use      //an MSXML 4.0 DOMDocument object to load the XML	x.open("GET", "/xmlFile.xml", false);	x.send();	window.alert("URL is " + x.responseXML.url);}</SCRIPT></head><body onload="loadXML();"></body></html>					
  3. Load the HTML file in Internet Explorer. A message box appears that says only, "URL is ".
For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Article ID: 234460 - Last Review: 02/21/2014 00:36:42 - Revision: 3.0

  • Microsoft Internet Explorer 4.0 128-Bit Edition
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 4.01 Service Pack 1
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 5.0
  • Microsoft Internet Explorer 5.01
  • Microsoft Internet Explorer 5.5
  • Microsoft XML Parser 2.0
  • Microsoft XML Parser 2.5
  • Microsoft XML Parser 3.0
  • Microsoft XML Parser 3.0 Service Pack 1
  • Microsoft XML Core Services 4.0
  • kbnosurvey kbarchive kbbug kbnofix KB234460