[xsl] Difference in Xalan & Saxon for format-number function

Subject: [xsl] Difference in Xalan & Saxon for format-number function
From: Bhupendra Singh <skbhupendra@xxxxxxxxxxx>
Date: Wed, 17 Nov 2004 23:32:28 +0000 (GMT)
Hi,
I have a template to format a decimal-string(for both
+ve and -ve numbers)
Postive numbers should be transformed  as it is but 
-ve number should be wrapped in ().

This is the XSL code.

<xsl:template name="formatCurrency">
 <xsl:param name = "stCurrency" /> 
 <xsl:variable name="formatedCurrency">
   <xsl:choose>
    <xsl:when test="starts-with($stCurrency,'-')">
	<xsl:value-of select="format-number
        ($stCurrency, '#,##0.00;(#0.00)')"/>
    </xsl:when>
    <xsl:otherwise>
	<xsl:value-of select="format-number
        ($stCurrency, '#,##0.00')"/>
    </xsl:otherwise>
   </xsl:choose>
 </xsl:variable>
 <xsl:value-of select="$formatedCurrency"/>	
</xsl:template>

Both are working fine for +ve numbers but -ve ones
have issues.

For a value of -263504.720000, I am getting
(263,504.72 in Xalan and (263504.72) in saxon8.

Saxon8 is working fine with the braces but looses the
formating and Xalan retains the formatting but looses
the closing ).

Any clues, what is the cause and what will be the
correct solution so that it works in both.

Thanks in advance.
Bhupendra.





________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

Current Thread