The code I have works fine if I remove the attributes from the 'photos_get_response' part, however with them there it won't work. I've tried reading the XPath guide on W3schools.com but to no avail. My source code is as follows:
Dim xml As XmlDocument = New XmlDocument
Dim nodelist As XmlNodeList
Dim node As XmlNode
Dim urllist As String = ""
xml.LoadXml(TextBox1.Text)
nodelist = xml.SelectNodes("/photos_get_response/photo")
For Each node In nodelist
urllist = urllist & node.ChildNodes.Item(4).InnerText & vbCrLf
Next
MsgBox(urllist)
Question
simsie
Hello all,
I'm trying to parse XML from the Facebook API... First here is the XML:
The code I have works fine if I remove the attributes from the 'photos_get_response' part, however with them there it won't work. I've tried reading the XPath guide on W3schools.com but to no avail. My source code is as follows:
Dim xml As XmlDocument = New XmlDocument Dim nodelist As XmlNodeList Dim node As XmlNode Dim urllist As String = "" xml.LoadXml(TextBox1.Text) nodelist = xml.SelectNodes("/photos_get_response/photo") For Each node In nodelist urllist = urllist & node.ChildNodes.Item(4).InnerText & vbCrLf Next MsgBox(urllist)Thank you to anyone out there who can help me!
Simsie
Link to comment
Share on other sites
5 answers to this question
Recommended Posts