[xquery-talk] fn:format-dateTime question

David Lee dlee at calldei.com
Mon Mar 12 06:46:14 PST 2012


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"),

१९९६   or  1996

And this

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

٩٦   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
dlee at calldei.com<mailto:dlee at calldei.com>
http://www.xmlsh.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://x-query.com/pipermail/talk/attachments/20120312/f6241559/attachment.html>


More information about the talk mailing list