I have the following question: I have an XML file with some elements that are an answer to a call to some web service. The problem is that I need to load this XML file and select a specific node, but if the websevice returns a response in which the element I'm trying to extract does not exist, my SelectSingleNode function will not throw an exception. I want to control this exception, but I am not trying to catch, possibly with if, something like:
if (xDoc.SelectSingleNode("//Node") == null) etc...
obviously this is not so, simply because I am asking this question. I hope I get it. Thanks in advance.
source share