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 -
        comment from my colleague Eike Rathke on this issue:

        There are several "feature" details missing in ODF number formats; not all OOo number format code possibilities can be stored in ODF; the problem is that these code things are very free form, the ODF definitions are something completely different.
        In this specific case it would need a "number:optional-decimal-places" attribute for the <number:number> element or some such ...
        Show
        Michael Stahl added a comment - comment from my colleague Eike Rathke on this issue: There are several "feature" details missing in ODF number formats; not all OOo number format code possibilities can be stored in ODF; the problem is that these code things are very free form, the ODF definitions are something completely different. In this specific case it would need a "number:optional-decimal-places" attribute for the <number:number> element or some such ...
        Hide
        Michael Stahl added a comment -
        Show
        Michael Stahl added a comment - A proposal to add the features requested here has been sent to the comment list: https://lists.oasis-open.org/archives/office-comment/201504/msg00001.html https://lists.oasis-open.org/archives/office-comment/201504/msg00002.html
        Hide
        Michael Stahl added a comment -
        Copied Laurent Balland-Poirier's proposal from the attached ODT file to Proposal field.
        Show
        Michael Stahl added a comment - Copied Laurent Balland-Poirier's proposal from the attached ODT file to Proposal field.
        Hide
        Michael Stahl added a comment -
        convert schema change proposal to unified diff
        Show
        Michael Stahl added a comment - convert schema change proposal to unified diff
        Hide
        Michael Stahl added a comment -
        As discussed in the call, there is a question if "exponent-sign" is the best name for the attribute:

        > The defined values for the number:exponent-sign attribute are:
        > * false: the exponent sign is displayed only for negative value of exponent, otherwise it is not displayed.

        the attribute does not determine if the sign is displayed, it determines if a positive sign is displayed,
        hence it would perhaps be better to name it "positive-exponent-sign".

        Andreas mentioned there is some other boolean "sign" attribute that works vey similarly to the proposed one, but i was unable to find it in ODF 1.2 part 1; please provide more details where it is.
        Show
        Michael Stahl added a comment - As discussed in the call, there is a question if "exponent-sign" is the best name for the attribute: > The defined values for the number:exponent-sign attribute are: > * false: the exponent sign is displayed only for negative value of exponent, otherwise it is not displayed. the attribute does not determine if the sign is displayed, it determines if a positive sign is displayed, hence it would perhaps be better to name it "positive-exponent-sign". Andreas mentioned there is some other boolean "sign" attribute that works vey similarly to the proposed one, but i was unable to find it in ODF 1.2 part 1; please provide more details where it is.
        Hide
        Michael Stahl added a comment -
        for easier reference, here's the "rationale" and "impacts" from Laurent's attachment:

        2 Rationale
        2.1. Use cases:
        Decimal number can have a variable number of decimal digits, if number:decimal-replacement attribute is set to empty string. Number of decimal digits may vary from 0 to number:decimal-places attribute value.
        In some case, it might be useful to consider a minimal number of decimal digits higher than 0. For instance, marks rounded to a quarter of point, should be displayed as: 10.0 8.5 7.75; i.e. at least one decimal digit, up to 2 decimal digits.
        Scientific numbers need some extra attributes to be more flexible:
        sign of the exponent may be ignored if exponent is positive, i.e. 1,234 should be displayed as 1.234E3 and not 1.234E+3.
        Like for decimal numbers, scientific numbers should have a variable length of their decimal part, i.e. 1,000 and 1,234 should be respectively displayed as 1E3 and 1.234E3 with the same format.
        Adding these attributes will improve MS-Office compatibility.
        These additions are independent and could be considered apart.
        2.2. Alternatives considered:
        No workaround.

        4 Impacts
        4.1. Conformance:
        No conformance issue known.
        4.2. Backwards compatibility:
        This addition will not cause a backward compatibility issue since they are new attributes.
        4.3. Accessibility impact:
        There is no impact on accessibility.
        Show
        Michael Stahl added a comment - for easier reference, here's the "rationale" and "impacts" from Laurent's attachment: 2 Rationale 2.1. Use cases: Decimal number can have a variable number of decimal digits, if number:decimal-replacement attribute is set to empty string. Number of decimal digits may vary from 0 to number:decimal-places attribute value. In some case, it might be useful to consider a minimal number of decimal digits higher than 0. For instance, marks rounded to a quarter of point, should be displayed as: 10.0 8.5 7.75; i.e. at least one decimal digit, up to 2 decimal digits. Scientific numbers need some extra attributes to be more flexible: sign of the exponent may be ignored if exponent is positive, i.e. 1,234 should be displayed as 1.234E3 and not 1.234E+3. Like for decimal numbers, scientific numbers should have a variable length of their decimal part, i.e. 1,000 and 1,234 should be respectively displayed as 1E3 and 1.234E3 with the same format. Adding these attributes will improve MS-Office compatibility. These additions are independent and could be considered apart. 2.2. Alternatives considered: No workaround. 4 Impacts 4.1. Conformance: No conformance issue known. 4.2. Backwards compatibility: This addition will not cause a backward compatibility issue since they are new attributes. 4.3. Accessibility impact: There is no impact on accessibility.
        Hide
        Andreas Guelzow added a comment -
        I note that Gnumeric uses gnm:forced-exponent-sign. using forced-exponent sign may be better than positive-exponent-sign=true may not show a positive sign but a minus.

        It looks like I was mistaken about having a "sign" specifier. We need to check how the excel format string "+0.00" is exported to ODF and possibly add a forced-sign or positive-sign attribute.

        Show
        Andreas Guelzow added a comment - I note that Gnumeric uses gnm:forced-exponent-sign. using forced-exponent sign may be better than positive-exponent-sign=true may not show a positive sign but a minus. It looks like I was mistaken about having a "sign" specifier. We need to check how the excel format string "+0.00" is exported to ODF and possibly add a forced-sign or positive-sign attribute.
        Hide
        Michael Stahl added a comment -
        a few cosmetic changes to proposal:

         0 if number:decimal-replacement attribute is equal to empty string
        =>
         0 if the value of the number:decimal-replacement attribute is the empty string

         it is set to the value of number:decimal-places attribute.
        =>
         it is set to the value of the number:decimal-places attribute.

         only for negative value of exponent
        =>
         only for a negative value of the exponent

         displayed whatever the value of exponent.
        =>
         displayed regardless of the value of the exponent.
        Show
        Michael Stahl added a comment - a few cosmetic changes to proposal:  0 if number:decimal-replacement attribute is equal to empty string =>  0 if the value of the number:decimal-replacement attribute is the empty string  it is set to the value of number:decimal-places attribute. =>  it is set to the value of the number:decimal-places attribute.  only for negative value of exponent =>  only for a negative value of the exponent  displayed whatever the value of exponent. =>  displayed regardless of the value of the exponent.
        Hide
        Michael Stahl added a comment -
        modified proposal to use "forced-exponent-sign" instead of "exponent-sign", as proposed by Andreas.
        Show
        Michael Stahl added a comment - modified proposal to use "forced-exponent-sign" instead of "exponent-sign", as proposed by Andreas.
        Hide
        Michael Stahl added a comment -
        ok found it; in 2008 we removed all "a:defaultValue" from the Relax NG schema due to a comment from Murata Makoto.

        https://wiki.oasis-open.org/office/proposal%3Adefault-values

        -> adapting the proposal to remove a:defaultValue
        Show
        Michael Stahl added a comment - ok found it; in 2008 we removed all "a:defaultValue" from the Relax NG schema due to a comment from Murata Makoto. https://wiki.oasis-open.org/office/proposal%3Adefault-values -> adapting the proposal to remove a:defaultValue
        Hide
        Andreas Guelzow added a comment -
        I am not sure about the interaction between number:min-decimal-digits and number:decimal-digits. We want to be able to specify what in "Excel" would be 0.000##. So one would want at least 3 decimal places shown and at most 5 with following 0s omitted (as long as we at least have 3 decimals).

        IN this case should number:min-decimal-digits=3 and number:decimal-digits=5? So do we have a restriction number:min-decimal-digits<=number:decimal-digits? If we do we should spell it out.

        Perhaps we really mean something like number:optional-decimal-digits=2 and number:decimal-digits=3 for 0.000##??
        Show
        Andreas Guelzow added a comment - I am not sure about the interaction between number:min-decimal-digits and number:decimal-digits. We want to be able to specify what in "Excel" would be 0.000##. So one would want at least 3 decimal places shown and at most 5 with following 0s omitted (as long as we at least have 3 decimals). IN this case should number:min-decimal-digits=3 and number:decimal-digits=5? So do we have a restriction number:min-decimal-digits<=number:decimal-digits? If we do we should spell it out. Perhaps we really mean something like number:optional-decimal-digits=2 and number:decimal-digits=3 for 0.000##??
        Hide
        Regina Henschel added a comment -
        Please look at the schema. The element "number:scientific-number" gets an attribute "number:min-exponent-digits" via reference "number-scientific-number-attlist" and another one via reference "common-min-decimal-digits-attlist"?
        Show
        Regina Henschel added a comment - Please look at the schema. The element "number:scientific-number" gets an attribute "number:min-exponent-digits" via reference "number-scientific-number-attlist" and another one via reference "common-min-decimal-digits-attlist"?
        Hide
        Michael Stahl added a comment -
        Regina,thanks for checking...
        "common-min-decimal-digits-attlist" does not add "number:min-exponent-digits" but "number:min-decimal-digits", note "exponent" vs. "decimal".
        Show
        Michael Stahl added a comment - Regina,thanks for checking... "common-min-decimal-digits-attlist" does not add "number:min-exponent-digits" but "number:min-decimal-digits", note "exponent" vs. "decimal".
        Hide
        Michael Stahl added a comment -
        so there are 2 different representations that are basically equivalent:

        1. use number:decimal-places to mean the total number of digits and new number:min-decimal-digits to mean that there is an optional suffix *of* that

        2. use number:decimal-places to mean the mandatory number of digits and new number:optional-decimal-digits to mean there is an optional suffix *in addition* to that

        the only difference to me is that the first appears to have better backward compatibility: if a consumer reads a file with the new attribute and does not understand it, it's probably better if it (wrongly) displays the "full" number of digits, than if it (wrongly) displays the minimum number of digits.

        i've added the sentence:

        "The value of the number:min-decimal-digits attribute shall not be greater than the value of the number:decimal-places attribute.“
        Show
        Michael Stahl added a comment - so there are 2 different representations that are basically equivalent: 1. use number:decimal-places to mean the total number of digits and new number:min-decimal-digits to mean that there is an optional suffix *of* that 2. use number:decimal-places to mean the mandatory number of digits and new number:optional-decimal-digits to mean there is an optional suffix *in addition* to that the only difference to me is that the first appears to have better backward compatibility: if a consumer reads a file with the new attribute and does not understand it, it's probably better if it (wrongly) displays the "full" number of digits, than if it (wrongly) displays the minimum number of digits. i've added the sentence: "The value of the number:min-decimal-digits attribute shall not be greater than the value of the number:decimal-places attribute.“
        Hide
        Michael Stahl added a comment -
        another problem: using the term "digits" to refer to digits following the decimal point appears to be incorrect; these are called "decimal places" (Eike agrees with me on that) so the attribute should be called "number:min-decimal-places".

        Proposal adapted accordingly.
        Show
        Michael Stahl added a comment - another problem: using the term "digits" to refer to digits following the decimal point appears to be incorrect; these are called "decimal places" (Eike agrees with me on that) so the attribute should be called "number:min-decimal-places". Proposal adapted accordingly.
        Hide
        Andreas Guelzow added a comment -
        I think what we still need is a clear description how number:decimal-places and number:min-decimal-places interact and how they specify the formatting of the number. Before this change number:decimal-places gave the number of decimal places used. With this change it apparently becomes the maximum number of decimal places shown while number:min-decimal-places is the minimum number of decimal places shown and within these limits trailing zeros are omitted. (At least that is what I think you are talking about).
        Show
        Andreas Guelzow added a comment - I think what we still need is a clear description how number:decimal-places and number:min-decimal-places interact and how they specify the formatting of the number. Before this change number:decimal-places gave the number of decimal places used. With this change it apparently becomes the maximum number of decimal places shown while number:min-decimal-places is the minimum number of decimal places shown and within these limits trailing zeros are omitted. (At least that is what I think you are talking about).
        Hide
        Andreas Guelzow added a comment -
        To emphasize: the change as it is proposed now would give us:

        The number:min-decimal-places attribute specifies the minimum number of digits in the decimal part.
        The number:decimal-places attribute specifies the number of decimal places to display.

        If number:min-decimal-places is not equal to number:decimal-places we need some explanatory text to say what the result for the number formatting should be.

        Show
        Andreas Guelzow added a comment - To emphasize: the change as it is proposed now would give us: The number:min-decimal-places attribute specifies the minimum number of digits in the decimal part. The number:decimal-places attribute specifies the number of decimal places to display. If number:min-decimal-places is not equal to number:decimal-places we need some explanatory text to say what the result for the number formatting should be.
        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: