Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

Symptoms

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

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


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

↑ Back to the top


References

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

↑ Back to the top


Keywords: kbbug, kbnofix, KB234460

↑ Back to the top

Article Info
Article ID : 234460
Revision : 3
Created on : 5/11/2006
Published on : 5/11/2006
Exists online : False
Views : 565