Avatar of DotNetNooby
DotNetNooby

asked on 

Loop through xml elements

My xml is below.  I want to loop through my xml and create a new map element based on the values in that RetailTowns node


For Each XElement In myXML.Elements
            Dim retailPushpin As New Pushpin
            retailPushpin.Name = myXML.Elements("Town").Value
            retailPushpin.Location = New Location(myXML.Elements("Longitude").Value, myXML.Elements("Latitude").Value)
            retailPushpin.Content = myXML.Elements("Town").Value
            retailPushpin.Visibility = Visibility.Visible

            retailTowns.Children.Add(retailPushpin)
        Next

Open in new window

RetailTowns.xml
Microsoft DevelopmentVisual Basic.NETXML

Avatar of undefined
Last Comment
DotNetNooby

8/22/2022 - Mon