I am trying to read an xml file using javascript in a jspx page. the code below is working using html and jsp but not jspx!!!!!?????

here are the functions, they are simple

function loadXMLDoc(xmlDir) {

if (window.XMLHttpRequest && navigator.appName != "Microsoft Internet Explorer") {
xhttp = new XMLHttpRequest();
}
else {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load(xmlDir);
return xmlDoc;

}
xhttp.open("GET", xmlDir, false);
xhttp.send();
return xhttp.responseXML;
}

function readXML() {
var xmlDoc = loadXMLDoc("resources/xml/test.xml");
var newel = xmlDoc.getElementsByTagName("NAME");
alert(newel.length); // this is what returns zero in jspx case

}

here is the xml file, locate it under web-inf>resources>xml

<?xml version="1.0" encoding="UTF-8" ?>
<RESULTS>
<ROW>
<ID>01</ID>
<NAME>FRANK</NAME>
<EMAIL>TEST1</EMAIL>
</ROW>
<ROW>
<ID>02</ID>
<NAME>WILLIAM</NAME>
<EMAIL>TEST2</EMAIL>
</ROW>
</RESULTS>

in jspx:
<f:facet name="metaContainer">
<af:resource type="javascript" source="resources/js/myjsFilel.js"/>
</f:facet>

<af:commandButton text="commandButton 1" id="cb1">
<af:clientListener type="click" method="readXML"/>
</af:commandButton>


your help is highly appreciated, thanks.