/* ===========================================================
模块说明:对于xml操作的一些补充功能charset:gb2312调用模块:搜集整理:最后修订:2011-12-06*/// 浏览器类型变量
var isIe = window.ActiveXObject;var isMoz = document.implementation && document.implementation.createDocument;// 根据实际的浏览器类型,智能创建XMLDOM对象
function XmlDom() { var xmlDom; if (window.ActiveXObject) { xmlDom = new ActiveXObject("Microsoft.XMLDOM"); } else if (document.implementation && document.implementation.createDocument) { xmlDom = document.implementation.createDocument("", "", null); } if (xmlDom == null) { throw new Error("MSXML is not installed on your browser."); } return xmlDom;}// 根据实际的浏览器类型,智能创建XMLDOM对象,然后同步方式读入一个XML文件
function importXmlSync(url) { var xmlDom = new XmlDom();xmlDom.async = false;
xmlDom.load(url);
if (isIe) { while (xmlDom.readyState != 4) { } }return xmlDom;
}