I am come to rely on the following pattern to get the XML of a selected
pattern with .NET 2.0
Dim xmlDocument As XPathDocument = New XPathDocument(xmlReader)
Dim navigator As XPathNavigator = xmlDocument.CreateNavigator()
Dim nodes As XPathNodeIterator = navigator.Select(queryString)
If nodes IsNot Nothing AndAlso nodes.Count 0 Then
Dim sb As System.Text.StringBuilder = New
System.Text.StringBuilder
While nodes.MoveNext()
sb.Append(nodes.Current.OuterXml)
End While
End If
But now I am forced back to .NET 1.1 and it seems that OuterXml is not
available. How can I acheive the same thing with .NET 1.1? I see in the
documentation that I can cast the navigator to IHasXmlNode and then get an
XmlNode from that cast. But the documentation indicates that this is only
valid for navigators created from XmlDocument not XPathDocument. Any
suggestions?
Kevin