<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Mangal;
        panose-1:2 4 5 3 5 2 3 3 2 2;}
@font-face
        {font-family:Mangal;
        panose-1:2 4 5 3 5 2 3 3 2 2;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Courier New \;color\:black";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Thanks for the confirmation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">----------------------------------------</span><span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">David A. Lee<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><a href="mailto:dlee@calldei.com">dlee@calldei.com</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><a href="http://www.xmlsh.org">http://www.xmlsh.org</a><o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext"> talk-bounces@x-query.com [mailto:talk-bounces@x-query.com]
<b>On Behalf Of </b>Michael Kay<br>
<b>Sent:</b> Monday, March 12, 2012 11:17 AM<br>
<b>To:</b> talk@x-query.com<br>
<b>Subject:</b> Re: [xquery-talk] fn:format-dateTime question<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The spec says:<br>
<br>
The language is used to select the appropriate language-dependent forms of:<br>
<br>
names (for example, of months)<br>
numbers expressed as words or as ordinals (twenty, 20th, twentieth)<br>
hour convention (0-23 vs 1-24, 0-11 vs 1-12)<br>
first day of week, first week of year<br>
<br>
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:
<a href="http://www.banmuang.co.th/">http://www.banmuang.co.th/</a>)<br>
<br>
Michael Kay<br>
Saxonica<br>
<br>
On 12/03/2012 14:46, David Lee wrote: <o:p></o:p></p>
<p class="MsoNormal">I'm having a hard time decyphering the specs for the new XQuery 3.0 fn:format-dateTime when it comes to numeric values.<o:p></o:p></p>
<p class="MsoNormal">In particular, if you pass a language argument does that take precidence over or affect at all numeric values.
<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">E.g.  what is the expected result of this : <o:p></o:p></p>
<p class="MsoNormal">fn:format-dateTime(xs:dateTime("1996-08-30T23:35:09.12-09:00"),"[Y]","hi","AD","US"),<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Mangal","serif"">१९९६   or  1996</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Mangal","serif""> </span><o:p></o:p></p>
<p class="MsoNormal">And this<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">fn:format-dateTime(xs:dateTime("1996-08-30T23:35:09.12-09:00"),"[Y01]","ar","AD","AE")
<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">٩٦   or 97</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif"">In the text for
</span><a href="http://www.w3.org/TR/2011/WD-xpath-functions-30-20111213/#func-format-dateTime">http://www.w3.org/TR/2011/WD-xpath-functions-30-20111213/#func-format-dateTime</a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal">But this example: <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<table class="MsoNormalTable" border="1" cellpadding="0" summary="A table [this is bad
          style]" style="background:white">
<tbody>
<tr>
<td valign="top" style="padding:3.75pt 3.75pt 3.75pt 3.75pt">
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Arial","sans-serif"">Jewish (with Western numbering)</span><o:p></o:p></p>
</td>
<td valign="top" style="padding:3.75pt 3.75pt 3.75pt 3.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif"">format-date($d, "[D] [Mn] [Y]", "he", "AM", ())</span><o:p></o:p></p>
</td>
<td valign="top" style="padding:3.75pt 3.75pt 3.75pt 3.75pt">
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Arial","sans-serif"">‏26 טבת 5763</span><o:p></o:p></p>
</td>
</tr>
<tr>
<td valign="top" style="padding:3.75pt 3.75pt 3.75pt 3.75pt">
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Arial","sans-serif"">Jewish (with traditional numbering)</span><o:p></o:p></p>
</td>
<td valign="top" style="padding:3.75pt 3.75pt 3.75pt 3.75pt">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New ;color:black","serif"">format-date($d, "[D&#x05D0;t] [Mn] [Y&#x05D0;t]", "he", "AM", ())</span><o:p></o:p></p>
</td>
<td valign="top" style="padding:3.75pt 3.75pt 3.75pt 3.75pt">
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Arial","sans-serif"">כ״ו טבת תשס״ג</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Implies that language with no format digits should be western,<o:p></o:p></p>
<p class="MsoNormal">and that format digits override language codes.<o:p></o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I do read this:<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p style="margin-left:.5in;background:white"><span style="font-size:13.5pt;font-family:"Arial","sans-serif"">The language is used to select the appropriate language-dependent forms of:</span><o:p></o:p></p>
<p style="margin-left:.5in;background:white"><span style="font-size:13.5pt;font-family:"Arial","sans-serif"">names (for example, of months)<br>
numbers expressed as words or as ordinals (</span><code><span style="font-size:10.0pt">twenty, 20th, twentieth</span></code><span style="font-size:13.5pt;font-family:"Arial","sans-serif"">)<br>
hour convention (0-23 vs 1-24, 0-11 vs 1-12)<br>
first day of week, first week of year</span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thanks for any suggestions. <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">----------------------------------------</span><o:p></o:p></p>
<p class="MsoNormal">David A. Lee<o:p></o:p></p>
<p class="MsoNormal"><a href="mailto:dlee@calldei.com">dlee@calldei.com</a><o:p></o:p></p>
<p class="MsoNormal"><a href="http://www.xmlsh.org">http://www.xmlsh.org</a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman","serif""><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre><a href="mailto:talk@x-query.com">talk@x-query.com</a><o:p></o:p></pre>
<pre><a href="http://x-query.com/mailman/listinfo/talk">http://x-query.com/mailman/listinfo/talk</a><o:p></o:p></pre>
</div>
</div>
</body>
</html>