xpath querty

  • Thread starter Thread starter rob willaar
  • Start date Start date
R

rob willaar

Hi all.

The following xpath select returns three nodes but i want to select only the
node where the 'appupdate' has attribute 'version=01'

There is lotsof info and samples but i can't find the right solution.



Dim Doc As XPathDocument = New XPathDocument(DataUrl)

Dim Nav As XPathNavigator = Doc.CreateNavigator()

Dim Iterator As XPathNodeIterator = Nav.Select("/root/appupdate/srcfile")

While Iterator.MoveNext()

MsgBox(Iterator.Current.Value)

End While
 
Rob,
The following xpath select returns three nodes but i want to select only
the
node where the 'appupdate' has attribute 'version=01'
Put a conditional on your xpath statement, something like:

Const xpath As String = "/root/appupdate[@version=01]/srcfile"

Dim Iterator As XPathNodeIterator = Nav.Select(xpath)

Hope this helps
Jay
 
Back
Top