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



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.01
  • Microsoft Internet Explorer (Programming) 5.5
  • Microsoft XML 2.0
  • Microsoft XML 2.5
  • Microsoft XML 3.0
  • Microsoft XML 3.0 SP1
  • Microsoft XML 4.0

This article was previously published under Q234460

SYMPTOMS

When you use the XMLHTTPRequest object to obtain XML data from another server, the responseXML's URL property comes up blank.

RESOLUTION

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.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

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 ".

REFERENCES

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbBug kbnofix KB234460