<?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>10792</bug_id>
          
          <creation_ts>2010-09-28 10:23:38 +0000</creation_ts>
          <short_desc>[FO3.0] format-integer - errors, negative values</short_desc>
          <delta_ts>2011-01-28 23:38:51 +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.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>jim.melton</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>39710</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-09-28 10:23:38 +0000</bug_when>
    <thetext>Further to bug #10729, two more questions about the spec of format-integer for the WGs to consider:

(a) Formatting of negative numbers. We currently say it should prepend a minus sign. This is needlessly different from xsl:number, which reverts to decimal notation, outputting -1 as -1 regardless of the formatting requested. With the format picture &quot;a&quot;, -1 probably makes more sense than -a. But with format picture &quot;w&quot;, &quot;minus one&quot; seems preferable to &quot;-one&quot;.

(b) Errors, especially errors in the format picture. At present, no error conditions are described. I think we should follow the precedent of format-date, which is that a syntax error in the format picture is a hard error, but requesting something that the implementation doesn&apos;t support (e.g. an unsupported language) always causes the number to be output in a fallback representation rather than causing an error. This leaves a question as to whether syntax errors in the format picture are possible. I think they are - for example, no alphanumeric characters in the picture, or two adjacent punctuation characters (grouping separators), or unmatched parentheses after the &quot;o&quot; format modifier.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41915</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-11-01 09:26:58 +0000</bug_when>
    <thetext>The WG agreed with the principle behind these two changes, MK has the action to draft detailed text.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42716</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-11-23 10:38:54 +0000</bug_when>
    <thetext>Detailed proposal (in section 4.5.1, format-integer):

(a) Remove this paragraph: &quot;The rules that follow describe how non-negative numbers are output. If the value of $value is negative, the rules below are applied to the absolute value of $value, and the result is prepended with a minus sign.&quot;

(b) After the paragraph starting &quot;For all format tokens other than the first kind above...&quot;, add a new paragraph:

&quot;If the number to be formatted is negative, the same principles apply. For some numbering sequences there is a natural way of representing negative numbers: for example |-5| in the case of format token &quot;1&quot;, or |minus five| in the case of format token &quot;w&quot;. For other sequences, there is no natural representation of negative numbers, and in such cases they should be output as if format token &quot;1&quot; had been used.&quot;

(c) Add an &quot;Error Conditions&quot; section to the entry:

An error is raised [FODF1290] if the value of $picture is syntactically invalid (for example, if it is empty, or contains unmatched parentheses after the |o| format modifier, or contains two adjacent grouping separators. No error is raised, however, when the picture is syntactically valid but does not represent any numbering sequence supported by the implementation; in this case the processor MUST fall back to representing the number as if the picture were specified as |1|.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44150</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2011-01-11 16:18:24 +0000</bug_when>
    <thetext>The proposal in comment #2 was accepted</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>44872</commentid>
    <comment_count>4</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2011-01-28 23:38:25 +0000</bug_when>
    <thetext>Because the proposal in comment #2 was accepted, and you are the reporter of the bug and the author of the accepted solution, and you were present when the decision was made, I have marked the bug RESOLVED/FIXED and the marked it CLOSED.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>