Mega Code Archive
XmlParserContext Class has context information required by the XmlReader to parse an XML fragment
Imports System
Imports System.IO
Imports System.Xml
Public Class Sample
Public Shared Sub Main()
Dim xmlFrag As String = "- A
- B
- C
"
Dim nt As New NameTable()
Dim nsmgr As New XmlNamespaceManager(nt)
nsmgr.AddNamespace("rk", "urn:store-items")
Dim context As New XmlParserContext(Nothing, nsmgr, Nothing, XmlSpace.None)
Dim settings As New XmlReaderSettings()
settings.ConformanceLevel = ConformanceLevel.Fragment
Dim reader As XmlReader = XmlReader.Create(New StringReader(xmlFrag), settings, context)
End Sub
End Class