J
Jesper
Hi,
I've read somewhere that try/catch shoudn't be used as an
alternative to if clauses (maybe it was in C++ regi).
However, when using XmlNode.SelectSingleNode(XPath
expression) to get a node, it throws an exception instead
of returning null if the node doesn't excist. I'm a bit
tentative to use a catch statement to handle this as this
is not in my program considered a severe error. Is my
conception of try/catch in C# wrong in relation to C++
or/and is there a way of query for the excistence of a
particular node in a Xml document without using catch if
the node isn't present in the document.
Best regards Jesper.
I've read somewhere that try/catch shoudn't be used as an
alternative to if clauses (maybe it was in C++ regi).
However, when using XmlNode.SelectSingleNode(XPath
expression) to get a node, it throws an exception instead
of returning null if the node doesn't excist. I'm a bit
tentative to use a catch statement to handle this as this
is not in my program considered a severe error. Is my
conception of try/catch in C# wrong in relation to C++
or/and is there a way of query for the excistence of a
particular node in a Xml document without using catch if
the node isn't present in the document.
Best regards Jesper.