Imports System
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
Dim reader As XmlTextReader = Nothing
Dim xmlFrag As String = " " & _
"AAA" & _
"novel" & _
""
Dim nt As New NameTable()
Dim nsmgr As New XmlNamespaceManager(nt)
nsmgr.AddNamespace("bk", "urn:sample")
Dim context As New XmlParserContext(Nothing, nsmgr, Nothing, XmlSpace.None)
reader = New XmlTextReader(xmlFrag, XmlNodeType.Element, context)
While reader.Read()
If reader.IsStartElement() Then
If reader.Prefix = String.Empty Then
Console.WriteLine("<{0}>", reader.LocalName)
Else
Console.Write("<{0}:{1}>", reader.Prefix, reader.LocalName)
Console.WriteLine(" The namespace URI is " & reader.NamespaceURI)
End If
End If
End While
End Sub
End Class