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=29655>.
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=29655

XString.num and number XSLT function return incorrect number with trailing whitespace

           Summary: XString.num and number XSLT function return incorrect
                    number with trailing whitespace
           Product: XalanJ2
           Version: 2.6
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xpath
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


The XString.num() and toDouble() methods truncate the floating point portion of a 
number if the string 
contains a number with trailing whitespace.  So, if the tag

<tag>    1.5    </tag>

is created with the DOM, and the number() xslt function is called, 1.0 is returned.  
This does not occur 
if that XML was in a file, parsed by Xerces and run through Xalan, but does occur if 
the tag is created in 
memory and run through Xalan.  This may be because the XStringForFSB class is used 
instead, which 
has the correct behavior.  A test case will be attached that demonstrates differences 
in behavior 
between the two classes, and a patch will be included that provides almost identical 
behavior between 
the two.  In general, the toDouble method in the XStringForFSB seems superior from a 
consistency and 
performance perspective.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to