XPathNavigator.SetTypedValue sets the typed value of the current node.
Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim settings As XmlReaderSettings = New XmlReaderSettings()
settings.Schemas.Add("http://www.domain.com/books", "domainBooks.xsd")
settings.ValidationType = ValidationType.Schema
Dim reader As XmlReader = XmlReader.Create("domainBooks.xml", settings)
Dim document As XmlDocument = New XmlDocument()
document.Load(reader)
Dim navigator As XPathNavigator = document.CreateNavigator()
navigator.MoveToChild("bookstore", "http://www.domain.com/books")
navigator.MoveToChild("book", "http://www.domain.com/books")
navigator.MoveToChild("price", "http://www.domain.com/books")
Dim price As New Decimal(19.99)
navigator.SetTypedValue(price)
navigator.MoveToParent()
Console.WriteLine(navigator.OuterXml)
End Sub
End Class
Related examples in the same category