XmlReader.MoveToFirstAttribute Method moves to the first attribute.
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)
reader.ReadToFollowing("book")
reader.MoveToFirstAttribute()
Dim genre As String = reader.Value
Console.WriteLine("The genre value: " + genre)
End Sub
End Class