asp修改xml文件,各位大虾指点下。
分不多,请谅解。急xml如下:
<?xml version="1.0" uncoding="utf-8"?>
<site>
<newlist names="luhehe" urls="www.baidu.com" mail="hehe@第一条留言</newlist>
<newlist names="lheiheie" urls="www.baidu.com" mail="hehheie@第二条留言</newlist>
</site>
代码如下:
strFile=Server.MapPath("xml\list.xml")
Set objXML=server.CreateObject("microsoft.xmldom")
objxml.async = "false"
objXML.load(strFile)
Set newnode=objXML.createElement("newlist")
newnode.text="第十条留言"
Set newatt=objXML.createNode("attribute","names","")
newatt.text="hahahaha"
newnode.SetAttributeNode newatt
Set newatt=objXML.createNode("attribute","urls","")
newatt.text="www.baidu.com"
newnode.SetAttributeNode newatt
Set newatt=objXML.createNode("attribute","mail","")
newatt.text="hahahaha@
newnode.SetAttributeNode newatt
set objNode = objXML.documentElement.selectsinglenode("site")
objNode.appendChild newnode
objXML.save(strFile)
错误如下:
Script error detected at line 38.
Source line: set objNode = objXML.documentElement.selectsinglenode("newlist")
Description: 缺少对象: 'objXML.documentElement'
请帮我解决下好么,我是想通过asp接收flash传过来的值 写进xml 然后再直接用flash 遍历xml 这样的方式 做一个 留言板,