xpath querty

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
 
J

Jay B. Harlow [MVP - Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top