danucalovj

Read XML file

May 22nd, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim xmldoc As New XmlDataDocument()
  2.         Dim xmlnode As XmlNodeList
  3.         Dim i As Integer
  4.         Dim str As String
  5.         Dim fs As New FileStream("products.xml", FileMode.Open, FileAccess.Read)
  6.         xmldoc.Load(fs)
  7.         xmlnode = xmldoc.GetElementsByTagName("Product")
  8.         For i = 0 To xmlnode.Count - 1
  9.             xmlnode(i).ChildNodes.Item(0).InnerText.Trim()
  10.             str = xmlnode(i).ChildNodes.Item(0).InnerText.Trim() & " | " & xmlnode(i).ChildNodes.Item(1).InnerText.Trim() & " | " & xmlnode(i).ChildNodes.Item(2).InnerText.Trim()
  11.             MsgBox(str)
  12.         Next
Advertisement
Add Comment
Please, Sign In to add comment