[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Difference in Xalan & Saxon for format-number function
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|