Subject: RE: [xsl] formatting numbers From: "Michael Kay" <mhk@xxxxxxxxx> Date: Thu, 27 May 2004 17:13:18 +0100 |
> 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] formatting numbers, David Carlisle | Thread | RE: [xsl] formatting numbers, vsubramanian |
RE: [xsl] Changing Attribute Value , Andreas L. Delmelle | Date | RE: [xsl] exclude-result-prefixes i, Passin, Tom |
Month |