为何XMLHTTP的ResponseXML返回DOM为空
我的XML:
<?xml version="1.0" encoding="GB2312"?>
<orders>
<order order_number="2233">
<customer>
<name>John Smith</name>
<custID>192883</custID>
</customer>
<item>
<name>Fly Swatter</name>
<price>9.99</price>
</item>
</order>
</orders>
我的处理脚本
<html>
<head>
<title>通过XMLHTTP获取XML文件内容</title>
<script language=javascript>
//建立XML HTTP对象
var xmlhttp=new ActiveXObject("MSXML2.XMLHTTP.4.0");
xmlhttp.open("GET","Orders.xml",false);
xmlhttp.send();
//获取响应的XML DOM
alert(xmlhttp.responseText); //这里是可以的
var xmldom=xmlhttp.responseXML;
alert(xmldom.xml); //为何这里不可以呢?结果为空?????????
</script>
<head>
<body>
</body>
</html>