下面写的是主要的程序部分,不能清除原来的数据
var dtable = document.getElementById("dataBody");
var teamEls = xmlHttp.responseXML.getElementsByTagName("team");
for(var i=0;i<teamEls.length;i++) {
var elTr = dtable.insertRow(i);
var teamEl = teamEls.item(i);
var elId = teamEl.getElementsByTagName("id");
var id = elId.item(0).firstChild.nodeValue;
var elTdId = elTr.insertCell(0);
elTdId.innerHTML = id;
var elName = teamEl.getElementsByTagName("name");
var name = elName.item(0).firstChild.nodeValue;
var elTdName = elTr.insertCell(1);
elTdName.innerHTML = name;
var elSlogan = teamEl.getElementsByTagName("slogan");
var slogan = elSlogan.item(0).firstChild.nodeValue;
var elTdSlogan = elTr.insertCell(2);
elTdSlogan.innerHTML = slogan;
var elLeader = teamEl.getElementsByTagName("leader");
var leader = elLeader.item(0).firstChild.nodeValue;
var elTdLeader = elTr.insertCell(3);
elTdLeader.innerHTML = leader;
}