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

RE: xsl:number format tokens in XSLT 1.0

Subject: RE: xsl:number format tokens in XSLT 1.0
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 16 Feb 2005 23:32:11 -0000
xsl number format
> For example, (results taken from Xalan and Saxon both)
> 
> <xsl:number value="8" format="001"> will produce "008"
> 
> similarly...
> 
> <xsl:number value="8" format="999"> will also produce "008"
> 
> The TR specifies that any token outside of the 5 predefined 
> types should 
> cause a numbering sequence beginning with that token. Can 
> anyone explain 
> more clearly why '999' doesn't fall into this category?

Interesting if both Saxon and Xalan have taken this route. There are similar
cases where I know they have interpreted the spec differently, for example
see what happens with a format token of "C".

I agree that a stricter reading of the spec would probably output "8" rather
than "008" in your example. But the details of xsl:number output, when the
format token isn't one of those specified (or to some extent even when it
is) are left very much to the good sense of the implementator. For example,
an implementation that (with format="999") represented 1 as 999 and 8 as 008
would be conformant, but not very useful.

Michael Kay
http://www.saxonica.com/

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.