var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if(this.status == 200 && this.readyState == this.DONE) {
xmlHttp.open("GET", "/examples/media/programming_languages.xml", true);
function findResult(xmlHttp) {
var xmlObj, path, result, nodeList, node;
xmlObj = xmlHttp.responseXML;
if (window.ActiveXObject !== undefined || xmlHttp.responseType == "msxml-document") {
xmlObj.setProperty("SelectionLanguage", "XPath");
nodeList = xmlObj.selectNodes(path);
for (i=0; i<nodeList.length; i++) {
result += nodeList[i].text + "<br>";
} else if (document.implementation && document.implementation.createDocument) {
nodeList = xmlObj.evaluate(path, xmlObj, null, XPathResult.ANY_TYPE, null);
node = nodeList.iterateNext();
result += node.firstChild.nodeValue + "<br>";
node = nodeList.iterateNext();
document.getElementById("text").innerHTML = result;
<button onclick="loadDoc()">경로 표현식 //version 확인!</button>