Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Xml Node Defining

Xml Node Defining

Scheduled Pinned Locked Moved Visual Basic
helpxmlquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MatrixCoder
    wrote on last edited by
    #1

    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 Sub

    How 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.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups