reading xml files in vb6

前端 未结 4 1460
时光取名叫无心
时光取名叫无心 2020-12-02 23:35

I know it is easier to read xml files in vb.net but since our appl is still on vb6, i need a work around. but somehow, i am stuck. also i do not have control over the xml fi

4条回答
  •  悲哀的现实
    2020-12-03 00:38

    Thank you, this questions answers helped me a lot. Took me 2 days to figure how,

    Set xmlDoc = CreateObject("Msxml2.DOMDocument")
    
    Dim nodeBook
    Dim nodeId
    xmlDoc.async = False
    xmlDoc.Load ("xmlfile url")
    If (xmlDoc.parseError.errorCode <> 0) Then
       Dim myErr
       Set myErr = xmlDoc.parseError
       MsgBox ("You have error " & myErr.reason)
    Else
       Set nodeBook = xmlDoc.selectSingleNode("//Program")
       Set nodeId = nodeBook.getAttributeNode("description")
       wscript.Echo nodeId.value
    End If
    

提交回复
热议问题