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

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

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.



Jeni Tennison
Received on Friday, 11 January 2002 11:35:26 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:09:42 UTC