//讀取XML檔
function loadXML(xml) {loadXML
var xmlDoc;
if (window.ActiveXObject) {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.load(xmlFileDoc.async = false;
xmlDoc.load(xmlFile);
}
else if (document.implementation && document.implementation.createDocument) {
xmlDoc = document.implementation.createDocument("", "", null);
xmlDoc.load(xmlFile);
} else {
alert('您的瀏覽器不支援該系統腳本!');
}
return xmlDoc;
}
//輸出XML檔案
function outXML(filename){
var xmlDoc = loadXML(filename);
var x = xmlDoc.getElementsByTagName("properties"); =x[0].outerHTML.replace(/,"return text;
}
function dirXML(xmlDoc){
var entry=xmlDoc. getElementsByTagName("properties")[0].getElementsByTagName("entry");
for (var i=0,j=entry.length; iconsole.log(entry[i ].getAttribute("key"));
console.log(entry[i].childNodes[0].nodeValue);
}
}