W3C home > Mailing lists > Public > www-xpath-comments@w3.org > January to March 2002

Re: Decimal Literal

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 11 Jan 2002 16:35:25 +0000
Message-ID: <122374278023.20020111163525@jenitennison.com>
To: www-xpath-comments@w3.org
CC: AndrewWatt2000@aol.com
Andrew Watt wrote:
> In Chapter 2.2.1 the definition of a Decimal Literal is described as
> follows: ("." [0-9]+) | ([0-9]+ "." [0-9]*)
>
> The period is the decimal separator in English but in many
> languages, German being one example, the decimal separator is the
> comma.
>
> How is it planned that this will be handled?

XML Schema defines the valid lexical representations of XML Schema
data types, and it uses standards such as having '.' as the decimal
separator in decimals and 'YYYY-MM-DD' as the format for dates.

My feeling is that in order to support conversion to/from other
locales, there should be parse/format pairs of functions.

XSLT already has format-number(); a parse-number() would handle the
case that you describe above (or possibly parse-decimal(),
parse-float(), parse-double() so that you could determine the return
type).

Similarly, I think that there should be parse-date(),
parse-dateTime(), parse-time() functions and a format-dateTime()
function. (Ref. the Dates and Times module in EXSLT
http://www.exslt.org/date/).

If there isn't sufficient demand for these functions for XQuery, they
could be added to XSLT specifically, which is (I think) a lot more
concerned about conversion to/from non-standard formats.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Friday, 11 January 2002 11:35:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:05:54 GMT