Cannot load local XML file using javascript?

I am using the following code in javascript to attempt to load an XML file so that I can get the values and use them for some logic. //loadXMLDoc function function loadXMLDoc(dname) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new... show more I am using the following code in javascript to attempt to load an XML file so that I can get the values and use them for some logic.
//loadXMLDoc function
function loadXMLDoc(dname) {
if (window.XMLHttpRequest) {
xhttp=new XMLHttpRequest();
}
else {
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}

//load xml file
xmlDoc=loadXMLDoc("file://localhost/C:...
x=xmlDoc.getElementsByTagName("Longitu...
y=x.childNodes[0];
txt=y.nodeValue;
alert(txt);

This is just a test code, and it does not seem to want to load the xml file. The error I get is "Access denied". Am I passing the write path name? Do I need to format it differently? Eventually I want to put this on a site, but right now I'd just like to test it locally on my own comp....any help would be great.

Again the path I'm using is file://localhost/C:/MapTest/EMSData.xml
3 answers 3