PDA

Visualizza la versione completa : [VB.NET] Parsing di un file XML


jookla
05-05-2011, 20:17
Ciao... Vorrei mettere in un array tutti i tag loc di questo xml e fare un echo.. ho provato a scrivere il codice... cosa devo correggere?

<url>
<loc>[url]http://www.google.it/kekte.html</loc>
<lastmod>2010-11-30</lastmod>
<changefreq>daily</changefreq>
<priority>1</priority>
</url>

Imports System.Xml
Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim xmlFile As XmlReader
xmlFile = XmlReader.Create("Product.xml", New XmlReaderSettings())
Dim ProductIDList As XmlNodeList =
ProductXml.SelectNodes("/url/loc")
For Each ProductNode As XmlNode In ProductIDList
LoadProduct(ProductNode.InnerText)
Next

End Sub

Loading