Microsoft KB Archive/234460

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

Article ID: 234460

Article Last Modified on 5/11/2006

-

APPLIES TO


 * 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 Core Services 4.0
 * Microsoft XML Parser 3.0 Service Pack 1
 * Microsoft XML Core Services 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.



Steps to Reproduce Behavior
  Save the following XML file as XmlFile.xml on the root folder of your Web server: 

  Save the following HTML file as TestXMLURL.htm on your Web server:

XMLHTTPRequest responseXML.url Test



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); }





 Load the HTML file in Internet Explorer. A message box appears that says only, "URL is ".</ol>

<div class="references_section">