SelectSingleNode return Nothing instead of Null
am 15.01.2008 15:29:28 von Larry BudProbably just a mistake in the documentation:
Public Overridable Function SelectSingleNode(ByVal xpath As String) As
System.Xml.XPath.XPathNavigator
Member of: System.Xml.XPath.XPathNavigator
Summary:
Selects a single node in the System.Xml.XPath.XPathNavigator using the
specified XPath query.
Parameters:
xpath: A System.String representing an XPath expression.
Return Values:
An System.Xml.XPath.XPathNavigator object that contains the first
matching node for the XPath query specified; otherwise, null if there
are no query results.
------------------------
The problem is that if it doesn't find the Xpath, it returns NOTHING,
not NULL.
I need to retrieve about 15 individual values. They are all
optional. So without putting a try/catch block around every request,
I have a function that checks if the value is nothing, and if so,
return an empty string, otherwise return the value.
Any better way to do this? This is part of a time critical app so
efficiency is of utmost importance.