xsl-list
[Top] [All Lists]

NaN and Infinity in format-number

2006-01-13 10:09:45
In the following stylesheet:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ Transform">
  <xsl:template match="/">
    1: <xsl:value-of select="format-number(0.0 div 0.0, '(#)')"/>
    2: <xsl:value-of select="format-number(1.0 div 0.0, '(#)')"/>
  </xsl:template>
</xsl:stylesheet>

...I see interesting results in Saxon 6 and Xalan 2.6:

    1: NaN
    2: (Infinity)

I was expecting either parenthesis around both values or no parenthesis at all. Is this a result of the XSLT 1.0 processors using DecimalFormat in the JDK?
Is this the conforming XSLT 1.0 behavior?

I noticed Saxon 8 puts parenthesis around both values. Is this an an XSLT 2.0 action?

Any help is appreciated!

-Jack

--~------------------------------------------------------------------
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>