Search XML in VBscript
来源:互联网 发布:如何加入淘宝客做推广 编辑:程序博客网 时间:2024/05/29 19:52
Recently, in my project, there is a requirment that need to search specific XML node by using vbscript, in that, meet several issues and work out finally, so record these here.
1. MSXML Version
As we know, there are several versions of MSXML from 3.0 to 6.0, here is link to provides detail.
In my opinion, you'd better choose V6.0 if possible, it supports Xpath friendly.
2. How to use MSXML in VBScript
Dim MSXML
Set MSXML = CreateObject("MSXML2.DOMDocument.6.0") 'Create the MSXML object
There are also some basic properites you need to configure before you use the object
Async = true
preserverWhiteSpace = true
validateOnParse = true
here is one properties I like to highlight, it is
MSXML.setProperty "SelectionLanguage", "XPath"
It lets you can use XPATH in your code.
And if in your xml file, there is xml namespace, you also have to set
MSXML.setProperty"SelectionNamespaces","xmlns:prefix='http://www.gbxml.org/schema'"
After you set the proper properties of MSXML object, you can use Load() to load your xml file
MSXML.Load("/Analyzed.xml")
Next, it is very easy, like you use xpath in C# code, there are two methods let you select the specific XML node,
SelectSingleNode(SearchString)
SelectNodes( SearchString )
- Search XML in VBscript
- REGULAR EXPRESSION IN VBSCRIPT
- 4. Procedures in VBScript
- Error handling in VBScript
- ASP、VBScript使用XML
- vbscript 读取xml文件
- vbScript 读取xml
- 3. Flow control in VBScript
- 6. Error handling in VBScript
- Elastic Search Search in Deepth
- 2 Datatype and variables in VBScript
- 后台vbscript中的xml操作类
- asp中vbscript访问xml文件
- VBScript
- VBScript
- vbscript
- vbscript
- VBScript
- BSP的几种映像方式
- pku 1833(排列) STL应用
- BSP启动序列个人梳理
- C# .NET 基本概念
- Dwr另一种用法
- Search XML in VBscript
- DM355 UBL 功能
- 只有在配置文件或 Page 指令中将 enableSessionState 设置为 true 时,才能使用会话状态。还请确保在应用程序配置的 // 节中包括..
- 关于静态存储区域,堆,栈
- string的简单实现
- 正则表达式30分钟入门教程
- PDF compare using Acrobat Professional
- iBatis的AutoResultMap 默认配置使用时候出现的问题
- 应用池即应用程序池