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

RE: formatting numbers

Subject: RE: formatting numbers
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 27 May 2004 17:13:18 +0100
formatting numbers java
> If executed with saxon7 produces what I would expect which is
> 
> 
> $ saxon7 fn.xsl fn.xsl
> 
> : 123,456,789.120
> : 123'456'789.120
> 
> 
> However saxon7 is mainly an xslt2 implementation and this is an XSLT1
> question but saxon6 produces
> 
> $ saxon fn.xsl fn.xsl
> 
> : 123,456,789.120
> : 123456789###.000
> 
> which is odd, but actually it looks like it isn't saxon bug 
> really, that
> was with instant saxon on windows (ie using Microsoft's JVM) 
> saxon6 using sun's JVM produces the same as saxon7:
> 
> $ saxon fn.xsl fn.xsl
> 
> : 123,456,789.120
> : 123'456'789.120
> 

Actually, format-number() in XSLT 1.0 is defined by reference to the JDK 1.1
specification of the DecimalFormat class, which treats apostrophes in the
picture string specially. I don't have access to the JDK 1.1 spec right now,
but it's entirely possible that the behavior of Instant Saxon is "correct"
(because it's using a JDK 1.1 Java implementation) and that the behavior
under later Java VMs is technically incorrect, even if it's more usable.
However, the JDK 1.1 spec for DecimalFormat is very woolly, so anything
goes, really.

Fortunately in XSLT 2.0 the dependency on a particular version of Java has
been removed.

Michael Kay

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.