重金属总量控制指标:ASP+XML读取问题

来源:百度文库 编辑:神马品牌网 时间:2024/04/27 14:13:19
我将如下代码放入我的空间,但服务器却提示 :Microsoft VBScript 运行时错误 错误 '800a01a8'

缺少对象)。请问高手这是怎么回事!

代码如下:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.Charset="UTF-8"%>
<html>
<title>read xml</title>
<body>
<%
dim node,i,nodecount
set Doc = CreateObject("Microsoft.XMLDOM")
Doc.async = false
Doc.load(Server.MapPath("data.xml"))
set root = Doc.documentElement
set nodeLis = root.childNodes
nodeCount = nodeLis.length
For i=1 to nodeCount
set node = nodeLis.nextNode()
set cost = node.attributes.getNamedItem("cost")
%>
第 <%=i%> 条记录:
<table border="1">
<tr>
<td width="16" rowspan="2"><img src="<%=node.selectSingleNode("img").text%>"/></td>
<td width="17">书名</td>
<td width="48">出版社</td>
<td width="32">价格</td>
</tr>
<tr>
<td>
<%=node.selectSingleNode("name").text%>
</td>
<td>
<%=node.selectSingleNode("publisher").text%>
</td>
<td>
<%= cost.text%>
</td>
</tr>
</table>
<%
Next
%>
</body>
</html>

XML数据:

<?xml version="1.0" encoding="utf-8"?>
<data>
<book cost="56">
<name>Dreamweaver</name>
<publisher>上海科技出版社</publisher>
<img>img/dw.jpg</img>
</book>
<book cost="62">
<name>Flash</name>
<publisher>铁道出版社</publisher>
<img>img/flash.jpg</img>
</book>
<book cost="48">
<name>Firweorks</name>
<publisher>教育出版社</publisher>
<img>img/fw.jpg</img>
</book>
</data>

Microsoft.XMLDOM这个东西注册了没有?