Using XPathNavigator to select single node : XPath « XML « VB.Net






Using XPathNavigator to select single node

   


Public Class Example6

    Shared Sub Main
        Dim doc As System.Xml.XmlDocument
        Dim editor As System.Xml.XPath.XPathNavigator

        doc = New System.Xml.XmlDocument()
        doc.Load("pubs.xml")
        editor = doc.CreateNavigator.SelectSingleNode("/pubs/publishers[@pub_id='0736']/@pub_name")
        editor.SetValue("new value")
        doc.Save("output.xml")
    End Sub
End Class

   
    
    
  








Related examples in the same category

1.Use XPath to do a 'select' commandUse XPath to do a 'select' command
2.XPathResultType.Number
3.XPathResultType.NodeSet
4.XPathResultType.Boolean
5.XPathResultType.String
6.Use the XPath return type to determine how to process the XPath expression