从九十到一百很难,但是从零到九十很简单。
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: