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

format-number in XSLT 1.0

Subject: format-number in XSLT 1.0
From: Jack Matheson <jack@xxxxxxxxxxxxxx>
Date: Tue, 25 Jan 2005 11:13:31 -0600
format number in xslt
I created a small example stylesheet to see how positive and negative format patterns are used, but something doesn't make sense to me.

Given the following stylesheet:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/">
pos: <xsl:value-of select="format-number(31415, '##,##.0;0000')"/>
neg: <xsl:value-of select="format-number(-31415, '##,##.0;0000')"/>
</xsl:template>
</xsl:stylesheet>


Xalan (bundled with my Java distribution) produces:
    pos: 3,14,15.0
    neg: -3,14,15.0

Saxon (8.2) produces
    pos: 3,14,15.0
    neg: 31415

Can anyone tell me which is correct? In Kay's XSLT 1.0 reference, I found this:

"If there is an explicit negative subpattern, it serves only to specify the negative prefix and suffix; the number of digits, minimal digits, and other characteristics are all the same as the positive pattern."

Doesn't this mean that the negative pattern should be identical to the positive pattern with a "-" prefix?

Any clarification is greatly appreciated =)

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.