I had a quick question - How do I use Xpath to search the following xml file? Or should I be using something else? Pls note that the file has xml empty tags.
xml file
Expand|Select|Wrap|Line Numbers
- <World>
- <Country Name ="Denmark"/>
- <Country Name ="Hungry"/>
- </World>
Expand|Select|Wrap|Line Numbers
- XmlDocument doc = new XmlDocument();
- doc.Load("C:\\world.xml");
- XmlNodeList nodeList;
- XmlNode root = doc.DocumentElement;
- nodeList = root.SelectNodes("World/[Country Name='Denmark']");
Expression must evaluate to a node-set.The error occured at the last line(5)
I would like the node list to have 'Denmark'. I highly appreciate any kind of suggestion.
Thanks
Kim
--------------------------------------------------------------------------------