tags:

views:

47

answers:

1

How do I search a xmldata file node for the exact text that I have in my string value.

Ie: string fullname = "John Smith" Search XmlData.xml for node "FullName" where the value of the text = "John Smith".

Thanks.

+1  A: 

Try an xpath expression that goes something like this:

//FullName[.='John Smith']

It means find any element that has the name FullName and the value "John Smith".

For a sample on how to load up the document and use an xpath query, see MSDN. To test some xpath queries on a sample document, try here.

Nader Shirazie