Here’s what I’ve got thus far:
Dim xpDoc As New XPathDocument(strXmlUrl & strXmlInfo(0) & "?xml=1")
Dim xpNav As XPathNavigator = xpDoc.CreateNavigator()
Dim xpExpression(9) As XPathExpression
Dim xpIter(9) As XPathNodeIterator
xpExpression(0) = xpNav.Compile("/profile/steamID64")
'etc.. up to 9
For i = 0 To 9
xpIter(i) = xpNav.[Select](xpExpression(i))
While xpIter(i).MoveNext()
If xpIter(i).Count <> 0 Then
strXmlInfo(i) = xpIter(i).Current.Value
Else
strXmlInfo(i) = ""
End If
End While
Next
These are the xml files that I’m parsing:
http://steamcommunity.com/id/brosephus?xml=1
Any way of handling this that would perform significantly better?
If you want to squeeze performance, I’m suggesting XmlReader. It’s forward-only though and of course a bit bulkier to use, you don’t get any shiny XPath expressions or anything. I can’t give any performance comparisons though, but it is seldom a bottleneck for me. I’m using it a lot for XML processing at work and it has never been a problem.
However there is the usual tradeoff between ease-of-use and performance of course. Maybe you should implement a version using the XmlReader and time them, it should give you a hint, if the difference is small enough you might as well stick with XPathNavigator as it’s easier to use. With XmlReader there is usually additional state to be maintained, depending on the complexity of the XML.