Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: ODF 1.2
    • Fix Version/s: ODF 1.3
    • Component/s: Formatting Properties
    • Labels:
      None
    • Resolution:
      Hide
      I. Schema changes:

      diff -u OpenDocument-v1.2-os-schema.rng 3860-schema.rng
      --- OpenDocument-v1.2-os-schema.rng 2015-05-11 15:10:17.769956374 +0200
      +++ 3860-schema.rng 2015-05-11 15:16:40.307446101 +0200
      @@ -12678,12 +12678,17 @@
        <define name="number-scientific-number-attlist">
        <optional>
        <attribute name="number:min-exponent-digits">
        <ref name="integer"/>
        </attribute>
        </optional>
      + <optional>
      + <attribute name="number:forced-exponent-sign">
      + <ref name="boolean"/>
      + </attribute>
      + </optional>
        </define>
        <define name="number-fraction">
        <element name="number:fraction">
        <ref name="number-fraction-attlist"/>
        <ref name="common-number-attlist"/>
        <empty/>
      @@ -13191,12 +13196,17 @@
        <define name="common-decimal-places-attlist">
        <optional>
        <attribute name="number:decimal-places">
        <ref name="integer"/>
        </attribute>
        </optional>
      + <optional>
      + <attribute name="number:min-decimal-places">
      + <ref name="integer"/>
      + </attribute>
      + </optional>
        </define>
        <define name="common-number-attlist">
        <interleave>
        <optional>
        <attribute name="number:min-integer-digits">
        <ref name="integer"/>


      II.
      Section 16.27.3 <number:number>

      Add to the generated "The <number:number> element has the following attributes:"

          number:min-decimal-places 19.xxy

      III.
      Section 16.27.5 <number:scientific-number>

      Add to the generated "The <number:scientific-number> element has the following attributes":

          number:min-decimal-places 19.xxy and number:forced-exponent-sign 19.xxz

      IV. Add new section:
      Section 19.xxy number:min-decimal-places

      Section 19.xxy.1 General
      The number:min-decimal-places attribute specifies the minimum number of digits in the decimal part.

      The value of the number:min-decimal-places attribute shall not be greater than the value of the number:decimal-places attribute.

      If the value of number:min-decimal-places is less than the value of number:decimal-places, trailing zero digits in decimal places following the position indicated by the value of number:min-decimal-places shall not be displayed.

      Section 19.xxy.2 <number:number>
      If the number:min-decimal-places attribute is not specified, it is set to:
      * 0 if the value of the number:decimal-replacement attribute is the empty string
      * the value of the number:decimal-places attribute in other cases.

      If both number:decimal-replacement and number:min-decimal-places attributes are present, and the number displayed is an integer, then the value of number:decimal-replacement shall be displayed.

      The number:min-decimal-places attribute is usable with the following element: <number:number> 16.27.3.
      The number:min-decimal-places attribute has the data type integer 18.2.

      Section 19.xxy.3 <number:scientific-number>
      If the number:min-decimal-places attribute is not specified, it is set to the value of the number:decimal-places attribute.

      The number:min-decimal-places attribute is usable with the following element: <number:scientific-number> 16.27.5.
      The number:min-decimal-places attribute has the data type integer 18.2.

      V. Add new section:
      Section 19.xxz number:forced-exponent-sign

      The number:forced-exponent-sign attribute specifies whether the sign of the exponent for a scientific number is always displayed.
      The defined values for the number:forced-exponent-sign attribute are:
      * false: the exponent sign is displayed only for a negative value of the exponent, otherwise it is not displayed.
      * true: the exponent sign is always displayed regardless of the value of exponent.

      The default value for this attribute is true.

      The number:forced-exponent-sign attribute is usable with the following element: <number:scientific-number> 16.27.5.
      The number:forced-exponent-sign attribute has the data type boolean 18.3.3.
      Show
      I. Schema changes: diff -u OpenDocument-v1.2-os-schema.rng 3860-schema.rng --- OpenDocument-v1.2-os-schema.rng 2015-05-11 15:10:17.769956374 +0200 +++ 3860-schema.rng 2015-05-11 15:16:40.307446101 +0200 @@ -12678,12 +12678,17 @@   <define name="number-scientific-number-attlist">   <optional>   <attribute name="number:min-exponent-digits">   <ref name="integer"/>   </attribute>   </optional> + <optional> + <attribute name="number:forced-exponent-sign"> + <ref name="boolean"/> + </attribute> + </optional>   </define>   <define name="number-fraction">   <element name="number:fraction">   <ref name="number-fraction-attlist"/>   <ref name="common-number-attlist"/>   <empty/> @@ -13191,12 +13196,17 @@   <define name="common-decimal-places-attlist">   <optional>   <attribute name="number:decimal-places">   <ref name="integer"/>   </attribute>   </optional> + <optional> + <attribute name="number:min-decimal-places"> + <ref name="integer"/> + </attribute> + </optional>   </define>   <define name="common-number-attlist">   <interleave>   <optional>   <attribute name="number:min-integer-digits">   <ref name="integer"/> II. Section 16.27.3 <number:number> Add to the generated "The <number:number> element has the following attributes:"     number:min-decimal-places 19.xxy III. Section 16.27.5 <number:scientific-number> Add to the generated "The <number:scientific-number> element has the following attributes":     number:min-decimal-places 19.xxy and number:forced-exponent-sign 19.xxz IV. Add new section: Section 19.xxy number:min-decimal-places Section 19.xxy.1 General The number:min-decimal-places attribute specifies the minimum number of digits in the decimal part. The value of the number:min-decimal-places attribute shall not be greater than the value of the number:decimal-places attribute. If the value of number:min-decimal-places is less than the value of number:decimal-places, trailing zero digits in decimal places following the position indicated by the value of number:min-decimal-places shall not be displayed. Section 19.xxy.2 <number:number> If the number:min-decimal-places attribute is not specified, it is set to: * 0 if the value of the number:decimal-replacement attribute is the empty string * the value of the number:decimal-places attribute in other cases. If both number:decimal-replacement and number:min-decimal-places attributes are present, and the number displayed is an integer, then the value of number:decimal-replacement shall be displayed. The number:min-decimal-places attribute is usable with the following element: <number:number> 16.27.3. The number:min-decimal-places attribute has the data type integer 18.2. Section 19.xxy.3 <number:scientific-number> If the number:min-decimal-places attribute is not specified, it is set to the value of the number:decimal-places attribute. The number:min-decimal-places attribute is usable with the following element: <number:scientific-number> 16.27.5. The number:min-decimal-places attribute has the data type integer 18.2. V. Add new section: Section 19.xxz number:forced-exponent-sign The number:forced-exponent-sign attribute specifies whether the sign of the exponent for a scientific number is always displayed. The defined values for the number:forced-exponent-sign attribute are: * false: the exponent sign is displayed only for a negative value of the exponent, otherwise it is not displayed. * true: the exponent sign is always displayed regardless of the value of exponent. The default value for this attribute is true. The number:forced-exponent-sign attribute is usable with the following element: <number:scientific-number> 16.27.5. The number:forced-exponent-sign attribute has the data type boolean 18.3.3.

      Description

      This relates to the comment received in https://lists.oasis-open.org/archives/office-comment/201407/msg00008.html

      Currently the number:number element use a single attribute number:decimal-places to specify the number of decimal digits to be used. This means that formats such as "0.00#" (specified here using the Excel number format syntax) cannot be translated into ODF without the use of conditional formatting.

      I would propose to add an attribute to allow for formats of this type.

        Activity

        Hide
        Michael Stahl added a comment -
        ok, how about this to document the interaction between the attributes:

        "If the value of number:min-decimal-places is less than the value of number:decimal-places, trailing zero digits in decimal places following the position indicated by the value of number:min-decimal-places shall not be displayed."

        "If both number:decimal-replacement and number:min-decimal-places attributes are present, and the number displayed is an integer, then the value of number:decimal-replacement shall be displayed."

        is this sufficient?
        Show
        Michael Stahl added a comment - ok, how about this to document the interaction between the attributes: "If the value of number:min-decimal-places is less than the value of number:decimal-places, trailing zero digits in decimal places following the position indicated by the value of number:min-decimal-places shall not be displayed." "If both number:decimal-replacement and number:min-decimal-places attributes are present, and the number displayed is an integer, then the value of number:decimal-replacement shall be displayed." is this sufficient?
        Hide
        Michael Stahl added a comment -
        Proposal updated with previous comment.
        Show
        Michael Stahl added a comment - Proposal updated with previous comment.
        Hide
        Regina Henschel added a comment -
        I think, that the schema can be more simple. (1) common-decimal-places-attlist is only used in number-number and number-scientific-number. That is the same for the proposed common-min-decimal-places-attlist. Therefore this proposed part is not necessary, but its content can be merged into the common-decimal-places-attlist. (2) Attributes are always unordered in XML, therefore an "interleave" on attributes is superfluous. http://www.w3.org/TR/REC-xml/#sec-starttags

        Proposal:
        --- OpenDocument-v1.2-os-schema.rng 2011-09-29 01:00:00.000000000 +0200
        +++ 3860v2-schema.rng 2015-07-05 19:49:55.047802100 +0200
        @@ -12681,6 +12681,11 @@
          <ref name="integer"/>
          </attribute>
          </optional>
        + <optional>
        + <attribute name="number:forced-exponent-sign">
        + <ref name="boolean"/>
        + </attribute>
        + </optional>
          </define>
          <define name="number-fraction">
          <element name="number:fraction">
        @@ -13194,6 +13199,11 @@
          <ref name="integer"/>
          </attribute>
          </optional>
        + <optional>
        + <attribute name="number:min-decimal-places">
        + <ref name="integer"/>
        + </attribute>
        + </optional>
          </define>
          <define name="common-number-attlist">
          <interleave>

         
        Show
        Regina Henschel added a comment - I think, that the schema can be more simple. (1) common-decimal-places-attlist is only used in number-number and number-scientific-number. That is the same for the proposed common-min-decimal-places-attlist. Therefore this proposed part is not necessary, but its content can be merged into the common-decimal-places-attlist. (2) Attributes are always unordered in XML, therefore an "interleave" on attributes is superfluous. http://www.w3.org/TR/REC-xml/#sec-starttags Proposal: --- OpenDocument-v1.2-os-schema.rng 2011-09-29 01:00:00.000000000 +0200 +++ 3860v2-schema.rng 2015-07-05 19:49:55.047802100 +0200 @@ -12681,6 +12681,11 @@   <ref name="integer"/>   </attribute>   </optional> + <optional> + <attribute name="number:forced-exponent-sign"> + <ref name="boolean"/> + </attribute> + </optional>   </define>   <define name="number-fraction">   <element name="number:fraction"> @@ -13194,6 +13199,11 @@   <ref name="integer"/>   </attribute>   </optional> + <optional> + <attribute name="number:min-decimal-places"> + <ref name="integer"/> + </attribute> + </optional>   </define>   <define name="common-number-attlist">   <interleave>  
        Hide
        Michael Stahl added a comment -
        have updated Proposal with Regina's suggestion.

        re (1): yes, this is obviously the case.

        re (2): i agree this is possible, and all the existing
          <interleave>...only-attributes-here...</interleave>
         in the specification are actually unnecessary.

        http://relaxng.org/spec-20011203.html#full-syntax

        how does it work?

        we start with

        <define name="foo-elem">
            <element name="foo">
               <ref name="bar-attr/>
            </element>
        </define>

        <define name="foo-attr">
            <optional><attribute name="bar"/></optional>
            <optional><attribute name="baz"/></optional>
        </define>

        apply "4.8. name attribute of element and attribute elements"

        <define name="foo-elem">
            <element>
                <name>foo</name>
                <ref name="bar-attr/>
            </element>
        </define>

        <define name="foo-attr">
            <optional><attribute><name>bar</name></attribute></optional>
            <optional><attribute><name>baz</name></attribute></optional>
        </define>

        apply "4.12. Number of child elements"

        <define name="foo-elem">
            <element>
                <name>foo</name>
                <ref name="bar-attr/>
            </element>
        </define>

        <define name="foo-attr">
            <group>
                <optional><attribute><name>bar</name><text/></attribute></optional>
                <optional><attribute><name>baz</name><text/></attribute></optional>
            </group>
        </define>

        apply "4.14. optional element"

        <define name="foo-elem">
            <element>
                <name>foo</name>
                <ref name="bar-attr/>
            </element>
        </define>

        <define name="foo-attr">
            <group>
                <choice>
                    <attribute><name>bar</name><text/></attribute>
                    <empty/>
                </choice>
                <choice>
                    <attribute><name>baz</name><text/></attribute>
                    <empty/>
                </choice>
            </group>
        </define>

        apply "4.19. define and ref elements"

        <define name="foo-elem">
            <element>
                <name>foo</name>
                <group>
                    <choice>
                        <attribute><name>bar</name><text/></attribute>
                        <empty/>
                    </choice>
                    <choice>
                        <attribute><name>baz</name><text/></attribute>
                        <empty/>
                    </choice>
                </group>
            </element>
        </define>

        now looking at the inference rules (6.2.6. interleave pattern, 6.2.2. group pattern), there is no difference between <group> and <interleave> if they contain only attributes; these only differ when there is more than one possible interleaving of <element> or <text> below them.

        sorry for the lengthy comment but at least i understand RelaxNG a little better now...
        Show
        Michael Stahl added a comment - have updated Proposal with Regina's suggestion. re (1): yes, this is obviously the case. re (2): i agree this is possible, and all the existing   <interleave>...only-attributes-here...</interleave>  in the specification are actually unnecessary. http://relaxng.org/spec-20011203.html#full-syntax how does it work? we start with <define name="foo-elem">     <element name="foo">        <ref name="bar-attr/>     </element> </define> <define name="foo-attr">     <optional><attribute name="bar"/></optional>     <optional><attribute name="baz"/></optional> </define> apply "4.8. name attribute of element and attribute elements" <define name="foo-elem">     <element>         <name>foo</name>         <ref name="bar-attr/>     </element> </define> <define name="foo-attr">     <optional><attribute><name>bar</name></attribute></optional>     <optional><attribute><name>baz</name></attribute></optional> </define> apply "4.12. Number of child elements" <define name="foo-elem">     <element>         <name>foo</name>         <ref name="bar-attr/>     </element> </define> <define name="foo-attr">     <group>         <optional><attribute><name>bar</name><text/></attribute></optional>         <optional><attribute><name>baz</name><text/></attribute></optional>     </group> </define> apply "4.14. optional element" <define name="foo-elem">     <element>         <name>foo</name>         <ref name="bar-attr/>     </element> </define> <define name="foo-attr">     <group>         <choice>             <attribute><name>bar</name><text/></attribute>             <empty/>         </choice>         <choice>             <attribute><name>baz</name><text/></attribute>             <empty/>         </choice>     </group> </define> apply "4.19. define and ref elements" <define name="foo-elem">     <element>         <name>foo</name>         <group>             <choice>                 <attribute><name>bar</name><text/></attribute>                 <empty/>             </choice>             <choice>                 <attribute><name>baz</name><text/></attribute>                 <empty/>             </choice>         </group>     </element> </define> now looking at the inference rules (6.2.6. interleave pattern, 6.2.2. group pattern), there is no difference between <group> and <interleave> if they contain only attributes; these only differ when there is more than one possible interleaving of <element> or <text> below them. sorry for the lengthy comment but at least i understand RelaxNG a little better now...
        Hide
        Michael Stahl added a comment -
        Show
        Michael Stahl added a comment - trying to set this one to RESOLVED, since we voted on it, see: https://www.oasis-open.org/apps/org/workgroup/office/download.php/56463/ODF-TC-Minutes-17-August-2015.txt

          People

          • Assignee:
            Andreas Guelzow
            Reporter:
            Andreas Guelzow
          • Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: