<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29615</bug_id>
          
          <creation_ts>2016-05-07 11:29:41 +0000</creation_ts>
          <short_desc>[F+O 3.1] roman and max-width year</short_desc>
          <delta_ts>2016-07-21 14:19:57 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Functions and Operators 3.1</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Benito van der Zander">benito</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>abel.braaksma</cc>
    
    <cc>andrew_coleman</cc>
    
    <cc>josh.spiegel</cc>
    
    <cc>liam</cc>
    
    <cc>mike</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>126366</commentid>
    <comment_count>0</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-05-07 11:29:41 +0000</bug_when>
    <thetext>Comment 10 in #29555 seems as if it could just as well apply to years that then are formatted Roman numbers.

Printing 2007 with &apos;[Yi,3-3]&apos; as vii instead as mmvii like in test case format-dateTime-006</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126367</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-05-07 16:38:07 +0000</bug_when>
    <thetext>So how would you use that rule to format the year 1999? I don&apos;t think years in roman numerals have ever been expressed modulo 100, and if they had, you couldn&apos;t express the requirement to do so by means of a minimum or maximum width.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126368</commentid>
    <comment_count>2</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-05-07 21:23:09 +0000</bug_when>
    <thetext>999 ?  cmxcix

Makes as much sense as truncating year 654321  to 54321 with max width 5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126389</commentid>
    <comment_count>3</comment_count>
    <who name="Josh Spiegel">josh.spiegel</who>
    <bug_when>2016-05-09 15:45:13 +0000</bug_when>
    <thetext>
The point of the truncation logic is to get the year to fit within the maximum width.  

format-date(xs:date(&quot;1998-01-01&quot;), &quot;[Y,2-2]&quot;) =&gt; 98
format-date(xs:date(&quot;1999-01-01&quot;), &quot;[Y,2-2]&quot;) =&gt; 99

If we applied this logic in the case of roman numerals, it would fail to print a value within the maximum width in many cases.  

format-date(xs:date(&quot;1998-01-01&quot;), &quot;[Yi,2-2]&quot;) =&gt; xcviii (instead of mcmxcviii)
format-date(xs:date(&quot;1999-01-01&quot;), &quot;[Yi,2-2]&quot;) =&gt; xcix (instead of mcmxcix)

And in some cases it will unnecessarily truncate the value. 

format-date(xs:date(&quot;0101-01-01&quot;), &quot;[Yi,2-2]&quot;) =&gt; i (instead of ci)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126390</commentid>
    <comment_count>4</comment_count>
    <who name="Liam R E Quin">liam</who>
    <bug_when>2016-05-09 18:10:45 +0000</bug_when>
    <thetext>On the whole people working with Roman numerals and fixed-width fields are in for a hard time, and will probably use string processing to do what they need. It seems specialist enough that I&apos;ve no clue how to predict a &quot;majority&quot; use case.

Josh&apos;s result - apply the width in decimal before conversion - and Benito&apos;s - apply the width in characters after conversion - both seem plausible and I don&apos;t see any reason to prefer one over the other in general.

Benito, when you opened this bug you didn&apos;t say that anything was wrong, nor what goes wrong, nor what you think ought to happen. Is anything wrong with the spec here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126392</commentid>
    <comment_count>5</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-05-09 19:37:57 +0000</bug_when>
    <thetext>I implemented comment 10 of #29555 and afterwards that test case failed

The comment says to truncate the year if there is a max width without exception

The specs says somewhere

&gt;If no mechanism is available for fitting the value within the specified maximum width (for example, when roman numerals are used), then the value should be output in its full representation.


but the comment provides a mechanism for the year and it gets shorter, even if it stays too long.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126393</commentid>
    <comment_count>6</comment_count>
    <who name="Benito van der Zander">benito</who>
    <bug_when>2016-05-09 19:44:35 +0000</bug_when>
    <thetext>&gt;Josh&apos;s result - apply the width in decimal before conversion - and Benito&apos;s - apply the width in characters after conversion - both seem plausible 

You switched me and Josh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126769</commentid>
    <comment_count>7</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-06-14 16:36:52 +0000</bug_when>
    <thetext>Please note that we currently say the following already about roman numerals and the width modifier:

&quot;If no mechanism is available for fitting the value within the specified maximum width (for example, when roman numerals are used), then the value should be output in its full representation.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126770</commentid>
    <comment_count>8</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-06-14 16:43:24 +0000</bug_when>
    <thetext>(which typically means that implementations are allowed to do as they wish if they feel that there is such mechanism, making it implementation-defined what happens if you try to truncate roman numerals, but the suggestion of the text, by means of &quot;should&quot;, is to do nothing in such cases)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126789</commentid>
    <comment_count>9</comment_count>
    <who name="Andrew Coleman">andrew_coleman</who>
    <bug_when>2016-06-17 10:20:57 +0000</bug_when>
    <thetext>At the meeting on 2016-06-14, the WG discussed this and acknowledge the comment. This will be used as input to the existing action item A-643-01 (MikeK to update proposal on Bug 29555)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>