Retrieve URI of an XML DOM object using Internet Explorer

lookingatit

New Member
In Firefox and Chrome the \[code\]documentURI\[/code\] property of the document node object of an XML DOM will return the URI of the DOM if it is created using the \[code\]XMLHTTPRequest\[/code\] object.Is there an equivalent property for the Internet Explorer DOM, and if so what is it? The \[code\]documentURI\[/code\], \[code\]url\[/code\], \[code\]URL\[/code\] and \[code\]baseURI\[/code\] properties all return either null or undefined.The MSXML documentation for the \[code\]url\[/code\] property made me hope that this would return the URL used in the HTTP request that created the DOM - but the example given doesn't use \[code\]XMLHTTPRequest\[/code\].The code I've used to create the DOM and then test the property is below:\[code\]function getXslDom(url) { if (typeof XMLHttpRequest == "undefined") { XMLHttpRequest = function () { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); }; } var req = new XMLHttpRequest(); req.open("GET", url, false); req.send(null); var status = req.status; if (status == 200 || status == 0) { return req.responseXML; } else { throw "HTTP request for " + url + " failed with status code: " + status; }};var xslDom = getXslDom('help.xsl');// the following shows "undefined" for IEwindow.alert(xslDom.documentURI);\[/code\]
 
Back
Top