This project is read-only.

Alternative solution to XPathReader and XPathCollection

Topics: Developer Forum, Project Management Forum, User Forum, XPathmania
Aug 27, 2007 at 8:09 PM
I used XPathReader and XPathCollection in XPathReader.dll and .NET Version 1.1. Is it possible to adopt that code to .NET 2.0 and MVP.XML. Are there any classes in MVP.XML or .NET 2 XML/XPATH namespace that provide similar functionality.

Here is an outline of my existing code:

Dim xc As New XPathCollection
Dim ontocList As Integer
Dim ontaglist As Integer
Dim oTopic As Integer
Dim oInfo As Integer

'Sections that need to be processed
ontocList = xc.Add("mydoc/content/toc")
ontaglist = xc.Add("mydoc/content/tags")
oTopic = xc.Add("mydoc/content/topic")
oInfo = xc.Add("mydoc/info")

Dim sXML As String
Dim xpReader As XPathReader
xpReader = New XPathReader("myDoc.xml", xc)
While (xpReader.ReadUntilMatch)
If xpReader.Match(oInfo) Then
sXML = xpReader.ReadOuterXml
'Process Info
End If
If xpReader.Match(ontocList) Then
'Process TOC
sXML = xpReader.ReadOuterXml
End if
If xpReader.Match(ontaglist) Then
sXML = xpReader.ReadOuterXml
'Process Tags
End if
'and additional processing steps
End While

An equivalent code outline in .NET 2 and MVP.XML 2 will be greatly appreciated.