check for an node with attribe using XmlDocument.SelectSingleNode

G

Guest

i am trying to check if a node with an attribute of value XXX exist
(it possible that still there isnt any node with the name GameType)
what do i do wrong beacuse the next code isnt working :
XmlDocument.SelectSingleNode("GamesZone/GameType/[@Ref=" & GameTypeRef & "]")

thnaks in advance
peleg
 
T

Teemu Keiski

Hi,

this should be asked in xml group.

However, shouldn't the XPath be

GamesZone/GameType[@Ref=" & GameTypeRef & "]"

instead of

GamesZone/GameType/[@Ref=" & GameTypeRef & "]"

Note the omitting of the / between GameType and first [
 

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

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top