Go to index number in XML file

I am new to xml and vb.net...so I am probably misunderstanding this process but:

Is it possible to GoTo a specific node index based on a specific nodes value?

I have a list box that is populated by an xml file.  I want to be able to select an item in the list box...and have it GoTo...the corresponding index.

My a very simplified example of my xml file looks kind of like this

<Resources> <--------------------------------(Index1)

So...if they select Bob in the listbox...I want currentresourceindex to be 1....how do I do this?

Who is Participating?
troyhalseyAuthor Commented:
Yes, everyone has told me that.  I have books on xpath....I don't know how to begin using xpath.  Can you provide with a sample of how xpath interacts with vb code?
ok heres a simplified version using xpath in vb.net

'----------Start Code----------'
        Dim oXML As New Xml.XmlDocument
        oXML.LoadXml("<?xml version='1.0'?><ResourceBook><Resources><Resource><Name>Bob</Name></Resource><Resource><Name>Frank</Name></Resource></Resources></ResourceBook>")

        Dim oNodeList As Xml.XmlNodeList = oXML.DocumentElement.SelectNodes("//Resource") 'grab all the Resource Nodes using xpath expression.
if (oNodeList.Count > 0) then
        MsgBox(oNodeList(1).InnerXml) 'grab the second one inner xml
        msgbox("None Found..")
end if
'----------END CODE----------'

troyhalseyAuthor Commented:
No objection, I will repost when I am ready to readdress the issue.  Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.