当前位置: 首页 > 图文教程 > 网络编程 > ASP > ASP+XML留言板介绍

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP+XML留言板介绍


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 151 ::
收藏到网摘: n/a

我开始学习xml时做了一个简单的xml留言板。
-------------------------------
创建一个新的XMLDOM object
server.createObject("Microsoft.XMLDOM")
--------------------------------
加载一个xml文件
set objXML=server.createObject("Microsoft.XMLDOM")
filepath=server.mappath("list.xml")
objXML.load(filepath)
这里不能直接load("list.xml"),不然会出错
--------------------------------
寻找单个节点
set objXML=server.createObject("Microsoft.XMLDOM")
destNode=objXML.selectSingleNode("NewList")
这里有个讲究就是这个singlenode不能为"root"
--------------------------------
保存xml文件
set objXML=server.createObject("Microsoft.XMLDOM")
filepath=server.mappath("list.xml")
objXML.save(filepath)
--------------------------------
添加xml节点
xmlNode="......"
set objXML=server.createObject("Microsoft.XMLDOM")
objXML.loadXML(xmlNode)
newNode=objXML.documentElement
myXML.appendChild(newNode)
--------------------------------
item参数
myXML.childNodes.item(2).text
在多个childNodes的情况下指向特定的Node

演示地址:http://www.xunuo.net/other/code/index.asp
下载地址:http://www.xunuo.net/other/code/leave.rar