<%
Dim xmldoc,xsldoc
set xmldoc=server.createobject("msxml2.domdocument")
xmldoc.load(server.mappath("xmlfile.xml"))
set xsldoc=server.createobject("msxml2.domdocument")
xsldoc.load(server.mappath("xslfile.xml"))
response.write xmldoc.transform(xsldoc) '显示
dim node
set node=xmldoc.createelement("elementName")
node.text="内容"
xmldoc.documentElement.append node '添加
i=3 ‘要删除的索引号
xmllen=xmldoc.documentElement.childNodes.length-1 '得到子节点长度
if i<xmllen then
set xmlChildNode=xmldoc.documentElement.childNodes(i)
xmldoc.documentElement.RemoveChild(xmlChildNode) '删除
end if
'查询
set Nodes=xmldoc.selectNodes("查询路径") '得到集合
set Node=xmldoc.selectSingleNode("查询路径") '得到单独节点