从九十到一百很难,但是从零到九十很简单。

VB Script: How to read xml node

上一篇 / 下一篇  2011-04-16 01:32:13 / 个人分类:VB Script

Dim xmlDoc, objNodeList, plot

Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load("c:\inetpub\wwwroot\test.xml")
Set bjNodeList = xmlDoc.getElementsByTagName("description")

If objNodeList.length > 0 then
For each x in objNodeList
plot=x.Text
msgbox plot
Next
Else
msgbox chr(34) & "description" & chr(34) & " field not found."
End If


-----------------------------------------

Dim description, filepath

Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.load("c:\test.xml")

Set ElemList = xmlDoc.getElementsByTagName("segment")
filepath = ElemList.item(0).getAttribute("filePath")
MsgBox filepath

Set ElemList = xmlDoc.getElementsByTagName("description")
plot = ElemList.item(0).Text
MsgBox plot


TAG:

 

评分:0

我来说两句

日历

« 2024-05-14  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 6266
  • 日志数: 11
  • 建立时间: 2010-05-08
  • 更新时间: 2011-09-14

RSS订阅

Open Toolbar