Mega Code Archive

 
Categories / VB.Net / XML
 

Returns an XmlNodeList containing a list of all descendant elements that match the specified Name

Imports System Imports System.IO Imports System.Xml public class Sample   public shared sub Main()     Dim doc as XmlDocument = new XmlDocument()     doc.Load("2books.xml")      Dim root as XmlElement = doc.DocumentElement      Dim elemList as XmlNodeList = root.GetElementsByTagName("title")      Dim i as integer      for i=0  to elemList.Count-1         Console.WriteLine(elemList.ItemOf(i).InnerXml)      next   end sub end class