Share Pastebin
Guest
Private paste!

Untitled

By: a guest | Apr 24th, 2010 | Syntax: VB.NET | Size: 0.66 KB | Hits: 126 | Expires: Never
Copy text to clipboard
  1. Imports System.IO
  2. Imports System.Xml
  3.  
  4. Module Module1
  5.  
  6.     Sub Main(ByVal sArgs() As String)
  7.  
  8.         Dim Xml As String
  9.         Xml = System.IO.File.ReadAllText("news_google.xml")
  10.  
  11.         Dim doc As XmlDocument = New XmlDocument()
  12.         doc.LoadXml(Xml)
  13.  
  14.         Dim nlist As XmlNodeList = doc.SelectNodes("//rss/channel/item/title")
  15.  
  16.         For Each n As XmlNode In nlist
  17.             Dim nodeName As String = n.Name
  18.             Dim title As String = n.InnerText
  19.  
  20.             Console.WriteLine("Node name: {0}", nodeName)
  21.             Console.WriteLine("Node contents: {0}", title)
  22.         Next
  23.  
  24.         Console.ReadLine()
  25.     End Sub
  26. End Module