<?xml version="1.0" encoding="gb2312"?>
<stocks date="2013-7-15" time="15:12:23" who="艹尼玛"></stocks>
'Response.CacheControl = "no-cache"
set xml = Server.CreateObject("MSXML2.domdocument")
xml.load Server.MapPath("system.xml")
'如果有错,报错
if xml.parseError.errorCode <> 0 then
Response.Write "xml.parseError.errorCode = " &xml.parseError.errorCode & "<br>"
Response.Write "xml.parseError.reason = " &xml.parseError.reason & "<br>"
Response.Write "xml.parseError.line = " &xml.parseError.line
Response.End
end if
'读取值
a = xml.documentElement.attributes.getNamedItem("date").text
b = xml.documentElement.attributes.getNamedItem("time").text
c = xml.documentElement.attributes.getNamedItem("who").text
response.Write(a & "|" & b & "|" & c)
'修改值
'xml.documentElement.setAttribute "date","2013-7-15"
'xml.Save(Server.MapPath("system.xml"))
set xml = nothing