xsl-list
[Top] [All Lists]

RE: [xsl] number() in Xpath overflows in Linux

2006-05-15 06:21:06

This issue is product-specific. First find out which XSLT processor you are
using. This is much more likely to be of relevance than your choice of
operating system. If you aren't sure, use the function
system-property('xsl:vendor') to find out. Then raise the issue with the
suppliers of that processor.

Michael Kay
http://www.saxonica.com/


We are using number() in our XSL Transformation,

number() in Xpath overflows for the numeric value 
"1000000000.000000000"
to "-844674407.3709551" in Linux environment.
1000000000.000000000 : Fails
1000000000.00000000  : Works

The xsl file is,
<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet 
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";><xsl:template
match="/">
  <xml>
  <body>
    <table border="1">
    <tr bgcolor="#9acd32">
      <th align="left">Price</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
      <td><xsl:value-of
select="(number(normalize-space(1000000000.000000000)))"/></td>
    </tr>
    </xsl:for-each>
    </table>
  </body>
  </xml>
</xsl:template></xsl:stylesheet> 

And the xml file is
<?xml version="1.0" encoding="ISO-8859-1"?> <catalog>
  <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>1000000000.000000000</price>
    <year>1985</year>
  </cd>
</catalog> 

Thanks,
Vishwa

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>