To read nodes of a certain tagname of an xml file,it's easy to access:
Sub Test() Dim http As Object, nod, nod2 Set http = CreateObject("Microsoft.XMLHTTP") http.Open "get", "http://www.w3schools.com/xml/simple.xml", False http.send For Each nod In http.responseXML.getElementsByTagName("food") For Each nod2 In nod.childNodes Debug.Print Left(StrConv(nod2.nodeName, vbProperCase) & Space(15), 15) & nod2.Text Next Debug.Print Next End Sub
posted on 2009-10-27 19:24 王峰炬 阅读(82) 评论(0) 编辑 收藏 举报