* David Thielen wrote in microsoft.public.dotnet.xml:
>If I have an XPathNavigator object and for a given xpath statement need to
know if the node exists, how should I do this? I have found for some xpath
functions it returns an empty string if the node does not exist but that is
also the result for an empty node.
I do not know how you use the XPathNavigator, but using methods that
return strings is not the right approach; also note that if your XPath
expression evaluates to a string, there is no way to determine whether
some nodes relevant for the expression exist or not. A simple method is
to use nav.Evaluate("boolean(...)") and cast the result to a boolean.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de ·
http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 ·
http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·
http://www.websitedev.de/