After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 60415 - format-number() of an empty string does not output NaN
format-number() of an empty string does not output NaN
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-09-12 12:08 UTC by Stephan Otte
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcases (551 bytes, text/plain)
2001-09-12 12:12 UTC, Stephan Otte
Details

Description Stephan Otte 2001-09-12 12:08:42 UTC
Stylesheet:
===========
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">
 
<xsl:template match="/">
case 1:
<xsl:value-of select="format-number('', '#.#')"/>
<!-- outputs NOT "NaN" as expected -->
 
case 2:
<xsl:value-of select="number('')"/>
<!-- outputs NaN, ok -->
 
case 3:
<xsl:value-of select="format-number(non/existing/path, '#.#')"/>
<!-- outputs NOT "NaN" as expected -->
 
case 4:
<xsl:value-of select="number(non/existing/path)"/>
<!-- outputs NaN, ok -->
 
</xsl:template>
</xsl:stylesheet>

====================================================
Output is:

<?xml version="1.0"?>
 
case 1:
0000000000000000000000000000000000000000000000000000000000000000.0000000000000000000000000000000000000000000000000000000000000000
 
case 2:
NaN
 
case 3:
0000000000000000000000000000000000000000000000000000000000000000.0000000000000000000000000000000000000000000000000000000000000000
 
case 4:
NaN

===================================================================
Cases 2 and 4 (number) are correct.
Cases 1 and 3 (format-number) should also output NaN!

Versioninfo:
Using libxml 20403, libxslt 10003 and libexslt 301
xsltproc was compiled against libxml 20403, libxslt 10003 and libexslt 301
libxslt 10003 was compiled against libxml 20403
libexslt 301 was compiled against libxml 20403

Stephan
Comment 1 Stephan Otte 2001-09-12 12:12:37 UTC
Created attachment 5587 [details]
testcases
Comment 3 Daniel Veillard 2001-10-30 18:45:35 UTC
I think this is fixed in the last 2 releases,

Daniel