You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2001/10/16 16:52:29 UTC

DO NOT REPLY [Bug 4199] New: - xsltc fails conf test string134 converting string to integer with exponential notation

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4199>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4199

xsltc fails conf test string134 converting string to integer with exponential notation

           Summary: xsltc fails conf test string134 converting string to
                    integer with exponential notation
           Product: XalanJ2
           Version: 2.0.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: org.apache.xalan.xsltc
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: tom.amiro@sun.com


When using the default conversion of decimal numbers to 
strings, XSLTC is using exponential notation for large 
numbers, whereas, Saxon, XT, and Xalan do not.

According to Section 4.3 in the XPATH 1.0 spec, http://www.w3.org/TR/xpath, when
a number is represented in decimal form:

  beyond the one required digit after the decimal point there must be as many,
  but only as many, more digits as are needed to uniquely distinguish the 
  number from all other IEEE 754 numeric values.

It doesn't explicitly say you can't use E notation, but the strong 
implication is that you shouldn't, which the other XSLT processors agree with.

Running xalan on string134
<?xml version="1.0" encoding="UTF-8"?>
<out>Positive numbers:
9.87654321012345,98.7654321012345,987.654321012345,9876.54321012345
98765.4321012345,987654.321012345,9876543.21012345,98765432.1012345
987654321.012345,9876543210.12345,98765432101.2345,987654321012.345
9876543210123.45,98765432101234.5
Negative numbers:
-9.87654321012345,-98.7654321012345,-987.654321012345,-9876.54321012345
-98765.4321012345,-987654.321012345,-9876543.21012345,-98765432.1012345
-987654321.012345,-9876543210.12345,-98765432101.2345,-987654321012.345
-9876543210123.45,-98765432101234.5
</out>


Running XSLTC with Xerces Parser on string134
<?xml version="1.0" encoding="UTF-8" ?>
<out>Positive numbers:
9.87654321012345,98.7654321012345,987.654321012345,9876.54321012345
98765.4321012345,987654.321012345,9876543.21012345,9.87654321012345E7
9.87654321012345E8,9.87654321012345E9,9.87654321012345E10,9.87654321012345E11
9.87654321012345E12,9.87654321012345E13
Negative numbers:
-9.87654321012345,-98.7654321012345,-987.654321012345,-9876.54321012345
-98765.4321012345,-987654.321012345,-9876543.21012345,-9.87654321012345E7
-9.87654321012345E8,-9.87654321012345E9,-9.87654321012345E10,-9.87654321012345E11
-9.87654321012345E12,-9.87654321012345E13
</out>

string134.xsl
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <!-- FileName: string134 -->
  <!-- Document: http://www.w3.org/TR/xpath -->
  <!-- DocVersion: 19991116 -->
  <!-- Section: 4.2 String Functions -->
  <!-- Creator: David Marston -->
  <!-- Purpose: Test of default (no functions) conversion of decimal numbers
with decimal point at all positions. -->

<xsl:template match="/">
  <out><xsl:text>Positive numbers:&#10;</xsl:text>
    <xsl:value-of select="9.87654321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="98.7654321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="987.654321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="9876.54321012345"/><xsl:text>&#10;</xsl:text>
    <xsl:value-of select="98765.4321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="987654.321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="9876543.21012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="98765432.1012345"/><xsl:text>&#10;</xsl:text>
    <xsl:value-of select="987654321.012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="9876543210.12345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="98765432101.2345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="987654321012.345"/><xsl:text>&#10;</xsl:text>
    <xsl:value-of select="9876543210123.45"/><xsl:text>,</xsl:text>
    <xsl:value-of select="98765432101234.5"/><xsl:text>&#10;</xsl:text>
    <xsl:text>Negative numbers:&#10;</xsl:text>
    <xsl:value-of select="-9.87654321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-98.7654321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-987.654321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-9876.54321012345"/><xsl:text>&#10;</xsl:text>
    <xsl:value-of select="-98765.4321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-987654.321012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-9876543.21012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-98765432.1012345"/><xsl:text>&#10;</xsl:text>
    <xsl:value-of select="-987654321.012345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-9876543210.12345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-98765432101.2345"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-987654321012.345"/><xsl:text>&#10;</xsl:text>
    <xsl:value-of select="-9876543210123.45"/><xsl:text>,</xsl:text>
    <xsl:value-of select="-98765432101234.5"/><xsl:text>&#10;</xsl:text>
  </out>
</xsl:template>

</xsl:stylesheet>