commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Pannier" <>
Subject [JXPATH] number('true') returns "NaN"?
Date Wed, 03 Dec 2003 22:25:03 GMT

I am trying to evaluate an XPath expression using the
"number" function against boolean data, and am getting
a return value of "NaN".

My data looks like this:


The expression I'm using is "number(*/bool)".

The result returned is a Double with a value of "NaN".
In fact, when I evaluate "number('true')", it returns "NaN".

The XPath spec says:

The number function converts its argument to a number as follows:
      boolean true is converted to 1; boolean false is converted to 0

Any ideas why the "number" function is not converting the boolean
value "true" to the number "1" in this case?

Steve Pannier
Jacada, Inc.
(763) 201-0002 Ext. 219

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message