[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: formatting numbers
> 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
|
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
|