XPathNavigator.SelectSingleNode(xpath == 3)
Question posted by: David Thielen
(Guest)
on
November 12th, 2005 05:09 AM
Hi;
How do I handle the following:
XPathNavigator nav = ...;
String str = nav.SelectSingleNode("floats/@ok").Value;
// works fine - returns 1.3
nav.SelectSingleNode("floats/@ok == 1.3");
// throws an exception
I expected the second to return a Boolean of true or a string of "true()". I
tried XPathNavigator.Evaluate("floats/@ok == 1.3") also - and it also threw
an exception.
How do I get this xapth statement to resolve?
--
thanks - dave
1
Answer Posted
And the answer is...
The correct xpath is = instead of ==.
I was using tests from my java code that uses dom4j/jaxen and it allowed ==.
--
thanks - dave
"David Thielen" wrote:
[color=blue]
> Hi;
>
> How do I handle the following:
>
> XPathNavigator nav = ...;
> String str = nav.SelectSingleNode("floats/@ok").Value;
> // works fine - returns 1.3
>
> nav.SelectSingleNode("floats/@ok == 1.3");
> // throws an exception
>
> I expected the second to return a Boolean of true or a string of "true()". I
> tried XPathNavigator.Evaluate("floats/@ok == 1.3") also - and it also threw
> an exception.
>
> How do I get this xapth statement to resolve?
>
> --
> thanks - dave[/color]
|
|
|
What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 196,846 network members.
Top Community Contributors
|