Sorry for the long XML sample below. The XML sample below has two records and each record has three similar Nodes (<datafield tag="500" >) What I want to accomplish is get the value of the second Node <datafield tag = “5000”>. The fallowing code I gets the value for all three nodes but I want something like get elementat(1). Appreciate your help.
I tried this but it didn’t worked MsgBox(xEle.Elements.ElementAt(1).Value)
Dim xd As XDocument = XDocument.Load("C:\Users\stopete\Desktop\Marc_convertxml.xml")
If xd IsNot Nothing Then
Dim datafields = From datafield In xd.Descendants("datafield")
Where (datafield.Attribute("tag").Value = "500")
For Each xEle In datafields
View Complete Post