Calls MoveToContent and tests if the current content node is a start tag or empty element tag
Imports System
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
Dim doc As New XmlDocument()
doc.Load("books.xml")
Dim nodeReader As New XmlNodeReader(doc)
Dim settings As New XmlReaderSettings()
settings.ValidationType = ValidationType.Schema
settings.Schemas.Add("urn:bookstore-schema", "books.xsd")
Dim reader As XmlReader = XmlReader.Create(nodeReader, settings)
While reader.Read()
If reader.IsStartElement("price") Then
Console.WriteLine(reader.ReadInnerXml())
End If
End While
End Sub
End Class