kennedymr2
Programmer
I am trying to read the values of the field <VALUE RNR="1">0</VALUE> <VALUE RNR="2">555.5</VALUE> etc
I can get NR_VALUES but not sure of how to get the above into the listbox
<?xml version="1.0"?>
<MAIN>
<MN>
<NR_VALUES>18</NR_VALUES>
<VALUE RNR="1">111.0</VALUE>
<VALUE RNR="2">555.5</VALUE>
<VALUE RNR="3">11.5</VALUE>
</MN>
</MAIN>
Dim pDoc As MSXML2.DOMDocument
Dim i As Long
Set pDoc = New DOMDocument
pDoc.async = False
List1.Clear
Dim xyz As String
If pDoc.Load("c:\test\xml.xml") Then
For i = 0 To pDoc.selectNodes("//MN").length - 1
xyz = pDoc.selectNodes("//MN").Item(i).selectSingleNode("NR_VALUES").Text & ","
List1.AddItem xyz
Next i
End If
Really appreciate any help
Regards Kennedymr2
I can get NR_VALUES but not sure of how to get the above into the listbox
<?xml version="1.0"?>
<MAIN>
<MN>
<NR_VALUES>18</NR_VALUES>
<VALUE RNR="1">111.0</VALUE>
<VALUE RNR="2">555.5</VALUE>
<VALUE RNR="3">11.5</VALUE>
</MN>
</MAIN>
Dim pDoc As MSXML2.DOMDocument
Dim i As Long
Set pDoc = New DOMDocument
pDoc.async = False
List1.Clear
Dim xyz As String
If pDoc.Load("c:\test\xml.xml") Then
For i = 0 To pDoc.selectNodes("//MN").length - 1
xyz = pDoc.selectNodes("//MN").Item(i).selectSingleNode("NR_VALUES").Text & ","
List1.AddItem xyz
Next i
End If
Really appreciate any help
Regards Kennedymr2