Mega Code Archive

 
Categories / VB.Net / XML
 

Selects the first XmlNode that matches the XPath expression

Imports System Imports System.IO Imports System.Xml public class Sample   public shared sub Main()     Dim doc as XmlDocument = new XmlDocument()     doc.Load("booksort.xml")     Dim book as XmlNode     Dim root as XmlNode = doc.DocumentElement     book=root.SelectSingleNode("descendant::book[author/last-name='Austen']")     book.LastChild.InnerText="15.95"     doc.Save(Console.Out)   end sub end class