E书首页 - 下载 - 范文 - IT - 秘书 - 专家 - 创业 - 健康 - 百科 - 电影 - 娱乐 - 写真 - 英语 - 技术 - BBS - BLOG
IT资讯 | 业 界 | 互 联 网 | 通 信 | 人 物 | 数 码 | 软 件 | 硬 件 | 游 戏 | 技术百科 | 搜索引擎 | 操作系统
网络编程 | 网页设计 | 图形图像 | 网络媒体 | 网络安全 | 防 火 墙 | 站长必修 | 建站相关 | 数 据 库 | 服 务 器
游客登录 安全防范 NET专区 PHOTOSHOP专题 设为首页 加入收藏
您现在的位置: 中华E书网 >> IT学院 >> 网络编程 >> XML专区 >> 正文
▎vbs类生成xml文件
vbs类生成xml文件
作者:佚名   文章来源:EBOOK-CN.COM   更新时间:2005-12-4 16:53:52
有两文件:
objXML.asp:测试文件
clsXML.asp:vbs类文件
代码:
objXML.asp

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#INCLUDE FILE="clsXML.asp"-->
<%
Dim objXML, strPath, str
Set objXML = New clsXML

strPath = Server.MapPath(".") & "\New.xml"

objXML.createFile strPath, "Root"
'Or If using an existing XML file:
'objXML.File = "C:\File.xml"

objXML.createRootChild "Images"

'Here only one attribute is added to the Images/Image Node
objXML.createChildNodeWAttr "Images", "Image", "id", "1"
objXML.updateField "Images//Image[@id=1]", "super.gif"
objXML.createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
Array(24, 31, 30)
objXML.createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
Array(24, 30, 29)
objXML.createRootNodeWAttr "Jobs", Array("Size", "Length", "Width"), _
Array(24, 31, 85)

'Notice that all three job nodes have size 24, all of those
'nodes will be updated
objXML.updateField "Jobs[@Size=24]", "24's"

'Notice that only two nodes have the specified XPath, hence
'only two new child nodes will be added
objXML.createChildNodeWAttr "Jobs[@Size=24 and @Length=31]", "Specs", _
Array("Wood", "Metal", "Color"), _
Array("Cedar", "Aluminum", "Green")

'It is always important to iterate through all of the nodes
'returned by this XPath query.
For Each str In objXML.getField("Jobs[@Size

[1] [2] [3] [4] [5] 下一页

  • 上一篇文章:

  • 下一篇文章:

  • 相关文章
    了解WEB页面工具语言XML(一)背景
    XHTML基础问答-给初学者
    XML与HTML的结合(下)
    XML与HTML的结合(上)
    XML简明教程第10课 :在C++ XML DSO中使用主…
    XML简明教程第9课:使用C++ XML DSO…
    XML简明教程第8课:访问经过类型定义的XML值
    XML简明教程第7课:在XML文档中使用数据类型
    XML简明教程第6课 使用XML Schema…
    XML简明教程第5课:使用XML名域
    XML简明教程第4课: 使用XML对象模型…
    XML简明教程第3课 处理XML数据岛…
    虚拟主机 | 数据恢复 | 操作系统
    网络游戏 | 液晶电视 | 数码相机
    电子商务 | 思科认证 | 系统集成
    防 火 墙 | 服 务 器 | 路 由 器
    ▎编辑推荐
    ▎最新热门
    ▎合作链接

    | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | |
    建议使用IE5.5以上版本浏览-感谢263数据中心 提供技术支持
    中华E书网 版权所有 本站通用网址:中华E书网
    沪ICP备05001118号