Groups | Blog | Home
all groups > dotnet xml > october 2005 >

dotnet xml : XPathNavigator.SelectSingleNode(xpath == 3)



David Thielen
10/12/2005 6:36:03 PM
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?

--
David Thielen
10/12/2005 6:48:02 PM
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


[quoted text, click to view]
AddThis Social Bookmark Button