commons-user mailing list archives

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

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:

<Nan_XSD>
    <str>333.44</str>
    <bool>true</bool>
</Nan_XSD>

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
spannier@jacada.com
http://www.jacada.com




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message