You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/05/04 00:29:15 UTC
DO NOT REPLY [Bug 28753] New: -
number() function doesn't work correctly on Boolean variable
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28753>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28753
number() function doesn't work correctly on Boolean variable
Summary: number() function doesn't work correctly on Boolean
variable
Product: Commons
Version: 1.1 Final
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: Other
Component: JXPath
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: sm@jacada.com
When running the number() function on a Boolean variable, as in the following
code:
JXPathContext context = JXPathContextFactory.newInstance().newContext
(null, null);
Variables vars = new BasicVariables();
vars.declareVariable("bool", new Boolean("true"));
context.setVariables(vars);
Number num = (Number)context.getValue("number($bool)");
System.out.println("num = " + num);
The value returned is NaN, instead of 1.0, as per the XPath spec.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org