commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28753] New: - number() function doesn't work correctly on Boolean variable
Date Mon, 03 May 2004 22:29:15 GMT
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


Mime
View raw message