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

Re: XSLT 2.0 format-number() question

Subject: Re: XSLT 2.0 format-number() question
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 20 Jun 2002 09:59:18 +0100
xslt 2.0 format number
Hi Mike,

> XSLT 2.0 says, regarding format-number():
>
> "The number is supplied as the value of the first argument. The
> required type of this argument is xsd:double; if the value is not of
> the right type, it is converted using the standard conversion rules"
>
> I'd like this to be more clear. What are "the standard conversion
> rules"?
>
> I have an idea what they are, but I'd like to not have to guess. Can
> we get an actual reference in there?

The functions defined in XSLT 2.0 are specified as being
"XSLT-specific additions to the core XPath function library", so it's
not too big a leap to get to the "function conversion rules" described
in Section 2.2.4 of XPath 2.0
(http://www.w3.org/TR/xpath20/#id-function-calls), but I agree that it
wouldn't hurt to have a reference to this section at the beginning of
Section 14 of the XSLT 2.0 spec.

> I also noticed XSLT 1.0's format-number() doesn't say that the
> conversion of the first argument to a number occurs at all; should I
> assume that it does?

In Section 3.2 of the XPath 1.0 spec
(http://www.w3.org/TR/xpath#section-Function-Calls) it says (my
emphasis):

 "A FunctionCall expression is evaluated by using the FunctionName to
  identify a function in the expression evaluation context function
  library, evaluating each of the Arguments, **converting each
  argument to the type required by the function**, and finally calling
  the function, passing it the converted arguments."

Since calls to the format-number() function are just like calls to any
other function, and format-number() is defined as requiring a number
as its first argument, I think it's reasonable to assume that the
first argument to format-number() gets converted to a number.
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.