zerogeek
asked on
Parse XML in VB .NET 2003 <result id="example">
The function in the attached code works great if I have an xml as shown on the top. However, I do not know how to read the bottom xml. Anyone want to help me out on this?
<xml>
<area>
<test>
<result> Example </result>
</test>
</area>
</xml>
Public Fuction ReadXML()
Dim xml As Object
Dim XMLDoc As New XmlDocument
Dim nodeList As XmlNodeList
' Dim node As XmlNode
XMLDoc.Load("C:\temp\example.xml")
nodeList = XMLDoc.SelectNodes("area/test/result")
For Each node As XmlNode In nodeList
Dim lsted As String = node.InnerText
lblisted.Items.Add(lsted)
Next
End Function
<xml>
<area>
<test>
<result id="example" hid="example2" other="example3">
</test>
</area>
</xml>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hello Wayne,
When i posted my code i did not read the comment by other expert.
I realize that partial part of my code already there. I will take care of this next time.
Thanks.
When i posted my code i did not read the comment by other expert.
I realize that partial part of my code already there. I will take care of this next time.
Thanks.
ASKER
Thank you. Both answers were great.
If you are going to make use of suggestions made by other experts, please be courteuos enough to acknowledge them.
Wayne