Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2226

Negative zero incorrectly formatted (maybe)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Invalid
    • 2.7
    • None
    • XPath-function
    • None

    Description

      This is based on OASIS Microsoft test case XSLTFunctions__testOn-0.00. Here's the output from libxml and Xalan

      ~/projects/xom/data/oasis-xslt-testsuite/tests/MSFT_Conformance_Tests/XSLTFunctions$ xsltproc testOn-0.xsl fmt-no.xml
      <DIV>0.00</DIV>
      ~/projects/xom/data/oasis-xslt-testsuite/tests/MSFT_Conformance_Tests/XSLTFunctions$ java5 -cp /Users/elharo/Downloads/xalan-j_2_7_0/xalan.jar org.apache.xalan.xslt.Process -IN fmt-no.xml -XSL testOn-0.xsl
      <DIV>-0.00</DIV>

      libxml (and the expected test case output) may be correct here. Then again maybe not. The question is really what format-number(round(-.5), '#,##0.00') should return. However, this is tricky because it really depends normatively on what Java 1.1 did, and off the top of my head I'm not sure about that. What did

      (new DecimalFormat("#,##0.00")).format(-0.0)

      return in Java 1.1? (Also, was it even possible to create negative 0 in Java 1.1? If so, how?)

      Attachments

        1. fmt-no.xml
          10 kB
          elharo
        2. testOn-0.xsl
          0.4 kB
          elharo

        Activity

          People

            Unassigned Unassigned
            elharo@metalab.unc.edu elharo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: