/*__________________________________________________________________________________ dat.db["item"][0]["title"] dat.db["item"][0]["description"] */ var dat={} dat.db={} dat.dbParse=function (path,func){ var dat = this.db var t_xml = new XML(); t_xml.ignoreWhite = true; t_xml.onLoad = function(success){ if(success){ var tmpA = this.firstChild.firstChild.firstChild while(tmpA){ switch(tmpA.nodeName){ case "item": if(!dat["item"]) dat["item"]=[] dat["item"].push({}) var tmpB = tmpA.firstChild while(tmpB){ dat["item"][dat["item"].length-1][tmpB.nodeName] = tmpB.firstChild.nodeValue tmpB = tmpB.nextSibling; } break; default: //title,description,lastBuildDate dat[tmpA.nodeName] = tmpA.firstChild.nodeValue; } tmpA = tmpA.nextSibling; } //¼ÌÐøÖ´ÐÐ func() } } t_xml.load(path) } dat.dbParse("doc.xml",function(){trace(this)})