Xml Node Defining
-
After finally getting somewhere with reading XML, I ran into a problem. I want to list all the feed titles in a listview, and then when I click on a title, I want to view the the "Description" tag corresponding to the selected item. What I am having trouble with is determining which item I have clicked so that I can display the corresponding description. Here is what I have now:
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
Dim XMLDoc As XmlDocument
Dim NodeListTitle As XmlNodeList
Dim NodeListText As XmlNodeList
Dim XmlDocNode As XmlNode
XMLDoc = New XmlDocument()
XMLDoc.Load("C:\feed.xml")
NodeListTitle = XMLDoc.SelectNodes("/rss/channel/item/title")
NodeListText = XMLDoc.SelectNodes("/rss/channel/item/description")'Determine what item is selected and display it's description
For Each XmlDocNode In NodeListText
PostBox.Text = XmlDocNode.InnerText
Next
End SubHow should I go about getting the selected item and determining it's description tag? And is this the proper way to read an XML file? Thanks for the help!
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.