IE下示例代码:
var xmlDoc = "<root><AlleyWay><Code>1103</Code><Name>胡同2</Name></AlleyWay><AlleyWay><Code>1105</Code><Name>胡同2</Name></AlleyWay></root>"; var ojson = []; var oXMLDoc = new XMLDOMDocument(); oXMLDoc.async = false; oXMLDoc.loadXML(unescape(xmlDoc)); var xmlCheckInfo = oXMLDoc.documentElement; var nodeList = xmlCheckInfo.childNodes; for (var i = 0; i < nodeList.length; i++) { var row1 = {}; var node = nodeList(i).childNodes; for (var k = 0; k < node.length; k++) { if (node.item(k).nodeName == "Code") { row1.Code = node.item(k).text; } } ojson.push(row1); } window.returnValue = ojson; window.close();