The spec says:

The language is used to select the appropriate language-dependent forms of:

names (for example, of months)
numbers expressed as words or as ordinals (twenty, 20th, twentieth)
hour convention (0-23 vs 1-24, 0-11 vs 1-12)
first day of week, first week of year

It isn't used to select what family of digits to use; that's done using the format token, for example D01 requests ASCII digits. In many languages, for example in business or scientific writing, western digits are often used in place of "native" digits, so the desired language is not a good way of selecting what digit family to use. (See here for example: http://www.banmuang.co.th/)

Michael Kay
Saxonica

On 12/03/2012 14:46, David Lee wrote:

I'm having a hard time decyphering the specs for the new XQuery 3.0 fn:format-dateTime when it comes to numeric values.

In particular, if you pass a language argument does that take precidence over or affect at all numeric values.

E.g.  what is the expected result of this :

fn:format-dateTime(xs:dateTime("1996-08-30T23:35:09.12-09:00"),"[Y]","hi","AD","US"),

1996   or  1996

And this

fn:format-dateTime(xs:dateTime("1996-08-30T23:35:09.12-09:00"),"[Y01]","ar","AD","AE")

96   or 97

In the text for http://www.w3.org/TR/2011/WD-xpath-functions-30-20111213/#func-format-dateTime

I don't find any description on how language affects numeric values, or on if the digit values have higher or lesser precidence then the values.

But this example:

Jewish (with Western numbering)

        

format-date($d, "[D] [Mn] [Y]", "he", "AM", ())

        

?26 ??? 5763

Jewish (with traditional numbering)

        

format-date($d, "[Dאt] [Mn] [Yאt]", "he", "AM", ())

        

?"? ??? ???"?

Implies that language with no format digits should be western,

and that format digits override language codes.

Any suggestions on how to clarify this in partiular a refence to the spec where the rules are defined. I'm sure I missed something.

I do read this:

The language is used to select the appropriate language-dependent forms of:

names (for example, of months)
numbers expressed as words or as ordinals (|twenty, 20th, twentieth|)
hour convention (0-23 vs 1-24, 0-11 vs 1-12)
first day of week, first week of year

To me this implies that languages has no effect at all on numeric formats. This is consistant with the example, but thats only by exclusion not inclusion of wording.

Thanks for any suggestions.

----------------------------------------

David A. Lee

[email protected] <mailto:[email protected]>

http://www.xmlsh.org



_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to