在XML中删除数据的时候出错"缺少对象: 'root.childNodes.item(...)' ",请大侠帮帮忙,在线等!!!
源代码:
<%
Set rootXML = server.CreateObject("MSXML.DOMDocument")
rootXML.async = false
rootXML.load server.MapPath("/Config\SendMailLog.config")
Set root = rootXML.documentelement
ss =request.Form("pcl")
if ss= "" then
response.Write("请选择要删除的记录 [ <a href=# onclick=history.go(-1)>返回</a> ]")
response.End()
end if
for each xm in request.Form("pcl")
set cNode = rootXML.documentElement.selectSingleNode("/EmailLog")
Maxlbid = root.childNodes.length - 1
for i=0 to Maxlbid
score = getAttValue(i,3)
if score= xm then
cNode.RemoveChild(cNode.childNodes(i))
rootXML.save server.MapPath("/Config\SendMailLog.config")
end if
next
next
Function getAttValue(ByVal nNode, ByVal nAtt)
getAttValue=root.childNodes.item(nNode).attributes.item(nAtt).value
End Function
%>
<table><tr>
<td>
<a href="<%=request.ServerVariables("HTTP_REFERER")%>">返回</a>
</td>
</tr></table>
在删除时候,报错:Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: 'root.childNodes.item(...)'
是什么原因??
在线等,急啊!!