[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Difference in Xalan & Saxon for format-number function

Subject: Difference in Xalan & Saxon for format-number function
From: Bhupendra Singh <skbhupendra@xxxxxxxxxxx>
Date: Wed, 17 Nov 2004 23:32:28 +0000 (GMT)
xalan format number
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.