By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,694 Members | 1,288 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,694 IT Pros & Developers. It's quick & easy.

xpath querty

P: n/a
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


Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

"rob willaar" <r.*******@xs4all.nl> wrote in message
news:41***********************@news.xs4all.nl... 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

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.