Hi Guys,
i have my xml like:
code:
I am trying to loop through the xml grabbing the values, then putting them in a listview, i can do the first part "name" but i'm not sure how to add in the "code" to the next column of the list view.
any help would be appreciated
thanks guys
Graham
i have my xml like:
PHP:
<?xml version="1.0" encoding="utf-8" ?>
<cities>
<city>
<name>Aberdeen</name>
<code>UK</code>
</city>
<city>
<name>Belfast</name>
<code>UK</code>
</city>
</cities>
code:
PHP:
'// Create an instance of the XML
Dim XMLItem As New Xml.XmlDocument
'// Find and load the XML file
XMLItem.Load("Cities/cities.xml")
Dim nodeList As XmlNodeList
nodeList = XMLItem.DocumentElement.SelectNodes("/cities/city/name")
Dim name As XmlNode
For Each name In nodeList
'MessageBox.Show(name.InnerText)
With listViewCities.Items.Add(name.InnerText)
.SubItems.Add("code")
End With
Next
I am trying to loop through the xml grabbing the values, then putting them in a listview, i can do the first part "name" but i'm not sure how to add in the "code" to the next column of the list view.
any help would be appreciated
thanks guys
Graham