Imports System Imports System.Xml Imports System.IO Imports System.Collections Imports Microsoft.VisualBasic 'http://support.microsoft.com/default.aspx?scid=kb;EN-US;q301225 Public module MyModule Sub Main() 'Dim strFile as String = Application.StartupPath() & "\SavedSnippets\SampleData\Contacts.xml" Dim strPath As String = "C:\Documents and Settings\Dan\Desktop\CodeSnippetCompiler\SavedSnippets\SampleData\" Dim strFile As String = strPath & "\TBAcalendar.xml" Dim strRecordName As String = "//day" Dim strOutput As String ReadXML(strFile, strRecordName) Console.Write("Press Enter to Continue") Console.ReadLine() End Sub Sub ReadXML(ByVal strXmlFileName As String, ByVal strRecordName As String) 'as HashTable Dim ht As New Hashtable ' Create an Xml document instance and load XML data. Dim doc As XmlDocument = New XmlDocument doc.Load(strXmlFileName) ' 1. Select all the Book titles by using an XPath query. Dim nodeList As XmlNodeList = doc.SelectNodes(strRecordName) Dim node As XmlNode Dim root As XmlElement = doc.DocumentElement Dim bolIsFirst As Boolean = True Dim e As XmlElement For Each e In root.ChildNodes Dim S As String = e.InnerText Dim nXml As String = e.LocalName ' e.HasChildNodes True/False ' e.OuterXml "Bla Bla" ' e.LocalName "Item" ' e.Name "Item" ' e.InnerXml "Bla Bla" ' e.InnerText "Bla Bla" ' e.NodeType 1 ??? Dim oXml As String = e.Name If oXml = "day" Then If Not (bolIsFirst) Then Console.WriteLine("") Console.WriteLine("

" & S & "