用xmlhttp读取整个文件就行了吧
function readformfile(){
   req = new ActiveXObject("Microsoft.XMLHTTP");
   if (req) {
      req.open("GET", "sxml.asp?selSource=ab&selTarget=jp&keyword=abc", true);
      req.send();
      var result = req.responseText;
   }
}

解决方案 »

  1.   

    var x = new ActiveXObject("Microsoft.XMLHTTP")
    x.open("GET",url,false)
    x.send()
    doc = x.responseXML
    nodes = doc.selectNodes("//node()")
    for(i=0;i<nodes.length;i++)
    alert(nodes[i].text)
      

  2.   

    function importXML()
    {
     if (document.implementation && document.implementation.createDocument)
     {
      xmlDoc = document.implementation.createDocument("", "", null);
      xmlDoc.onload = createTable;
     }
     else if (window.ActiveXObject)
     {
      xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
      xmlDoc.onreadystatechange = function () {
       if (xmlDoc.readyState == 4) createTable()
      };
      }
     else
     {
      alert('Your browser can\'t handle this script');
      return;
     }
     xmlDoc.load("D:\emperors.xml");
    }
    function createTable()
    {
     var x = xmlDoc.getElementsByTagName('emperor'); //**************
        var a=x[0].childNodes[0].nodeName;
     var b=x[0].childNodes[0].firstChild.nodeValue;
     x[0].childNodes[0].firstChild.nodeValue="123";
     alert(a);
     alert(b);
     //**************
     var newEl = document.createElement('TABLE');
     newEl.setAttribute('cellPadding',5);
     var tmp = document.createElement('TBODY');
     newEl.appendChild(tmp);
     var row = document.createElement('TR');
     for (j=0;j<x[0].childNodes.length;j++)
     {
      if (x[0].childNodes[j].nodeType != 1) continue;
      var container = document.createElement('TH');
      var theData = document.createTextNode(x[0].childNodes[j].nodeName);
      container.appendChild(theData);
      row.appendChild(container);
     }
     tmp.appendChild(row);
     for (i=0;i<x.length;i++)
     {
      var row = document.createElement('TR');
      for (j=0;j<x[i].childNodes.length;j++)
      {
       if (x[i].childNodes[j].nodeType != 1) continue;
       var container = document.createElement('TD');
       var theData = document.createTextNode(x[i].childNodes[j].firstChild.nodeValue);
       container.appendChild(theData);
       row.appendChild(container);
      }
      tmp.appendChild(row);
     }
     document.getElementById('ABc').appendChild(newEl);
    }  <br>
    <input type="button" name="AB" value="aaaa" onClick="importXML()">
    <div id="ABc">
    </div>