Details

Type: New Feature

Status: Resolved

Priority: Minor

Resolution: Fixed

Affects Version/s: ODF 1.2

Fix Version/s: ODF 1.3

Component/s: Formatting Properties

Labels:None

Resolution:HideI. Schema changes:
diff u OpenDocumentv1.2osschema.rng 3860schema.rng
 OpenDocumentv1.2osschema.rng 20150511 15:10:17.769956374 +0200
+++ 3860schema.rng 20150511 15:16:40.307446101 +0200
@@ 12678,12 +12678,17 @@
<define name="numberscientificnumberattlist">
<optional>
<attribute name="number:minexponentdigits">
<ref name="integer"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="number:forcedexponentsign">
+ <ref name="boolean"/>
+ </attribute>
+ </optional>
</define>
<define name="numberfraction">
<element name="number:fraction">
<ref name="numberfractionattlist"/>
<ref name="commonnumberattlist"/>
<empty/>
@@ 13191,12 +13196,17 @@
<define name="commondecimalplacesattlist">
<optional>
<attribute name="number:decimalplaces">
<ref name="integer"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="number:mindecimalplaces">
+ <ref name="integer"/>
+ </attribute>
+ </optional>
</define>
<define name="commonnumberattlist">
<interleave>
<optional>
<attribute name="number:minintegerdigits">
<ref name="integer"/>
II.
Section 16.27.3 <number:number>
Add to the generated "The <number:number> element has the following attributes:"
number:mindecimalplaces 19.xxy
III.
Section 16.27.5 <number:scientificnumber>
Add to the generated "The <number:scientificnumber> element has the following attributes":
number:mindecimalplaces 19.xxy and number:forcedexponentsign 19.xxz
IV. Add new section:
Section 19.xxy number:mindecimalplaces
Section 19.xxy.1 General
The number:mindecimalplaces attribute specifies the minimum number of digits in the decimal part.
The value of the number:mindecimalplaces attribute shall not be greater than the value of the number:decimalplaces attribute.
If the value of number:mindecimalplaces is less than the value of number:decimalplaces, trailing zero digits in decimal places following the position indicated by the value of number:mindecimalplaces shall not be displayed.
Section 19.xxy.2 <number:number>
If the number:mindecimalplaces attribute is not specified, it is set to:
* 0 if the value of the number:decimalreplacement attribute is the empty string
* the value of the number:decimalplaces attribute in other cases.
If both number:decimalreplacement and number:mindecimalplaces attributes are present, and the number displayed is an integer, then the value of number:decimalreplacement shall be displayed.
The number:mindecimalplaces attribute is usable with the following element: <number:number> 16.27.3.
The number:mindecimalplaces attribute has the data type integer 18.2.
Section 19.xxy.3 <number:scientificnumber>
If the number:mindecimalplaces attribute is not specified, it is set to the value of the number:decimalplaces attribute.
The number:mindecimalplaces attribute is usable with the following element: <number:scientificnumber> 16.27.5.
The number:mindecimalplaces attribute has the data type integer 18.2.
V. Add new section:
Section 19.xxz number:forcedexponentsign
The number:forcedexponentsign attribute specifies whether the sign of the exponent for a scientific number is always displayed.
The defined values for the number:forcedexponentsign 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:forcedexponentsign attribute is usable with the following element: <number:scientificnumber> 16.27.5.
The number:forcedexponentsign attribute has the data type boolean 18.3.3.ShowI. Schema changes: diff u OpenDocumentv1.2osschema.rng 3860schema.rng  OpenDocumentv1.2osschema.rng 20150511 15:10:17.769956374 +0200 +++ 3860schema.rng 20150511 15:16:40.307446101 +0200 @@ 12678,12 +12678,17 @@ <define name="numberscientificnumberattlist"> <optional> <attribute name="number:minexponentdigits"> <ref name="integer"/> </attribute> </optional> + <optional> + <attribute name="number:forcedexponentsign"> + <ref name="boolean"/> + </attribute> + </optional> </define> <define name="numberfraction"> <element name="number:fraction"> <ref name="numberfractionattlist"/> <ref name="commonnumberattlist"/> <empty/> @@ 13191,12 +13196,17 @@ <define name="commondecimalplacesattlist"> <optional> <attribute name="number:decimalplaces"> <ref name="integer"/> </attribute> </optional> + <optional> + <attribute name="number:mindecimalplaces"> + <ref name="integer"/> + </attribute> + </optional> </define> <define name="commonnumberattlist"> <interleave> <optional> <attribute name="number:minintegerdigits"> <ref name="integer"/> II. Section 16.27.3 <number:number> Add to the generated "The <number:number> element has the following attributes:" number:mindecimalplaces 19.xxy III. Section 16.27.5 <number:scientificnumber> Add to the generated "The <number:scientificnumber> element has the following attributes": number:mindecimalplaces 19.xxy and number:forcedexponentsign 19.xxz IV. Add new section: Section 19.xxy number:mindecimalplaces Section 19.xxy.1 General The number:mindecimalplaces attribute specifies the minimum number of digits in the decimal part. The value of the number:mindecimalplaces attribute shall not be greater than the value of the number:decimalplaces attribute. If the value of number:mindecimalplaces is less than the value of number:decimalplaces, trailing zero digits in decimal places following the position indicated by the value of number:mindecimalplaces shall not be displayed. Section 19.xxy.2 <number:number> If the number:mindecimalplaces attribute is not specified, it is set to: * 0 if the value of the number:decimalreplacement attribute is the empty string * the value of the number:decimalplaces attribute in other cases. If both number:decimalreplacement and number:mindecimalplaces attributes are present, and the number displayed is an integer, then the value of number:decimalreplacement shall be displayed. The number:mindecimalplaces attribute is usable with the following element: <number:number> 16.27.3. The number:mindecimalplaces attribute has the data type integer 18.2. Section 19.xxy.3 <number:scientificnumber> If the number:mindecimalplaces attribute is not specified, it is set to the value of the number:decimalplaces attribute. The number:mindecimalplaces attribute is usable with the following element: <number:scientificnumber> 16.27.5. The number:mindecimalplaces attribute has the data type integer 18.2. V. Add new section: Section 19.xxz number:forcedexponentsign The number:forcedexponentsign attribute specifies whether the sign of the exponent for a scientific number is always displayed. The defined values for the number:forcedexponentsign 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:forcedexponentsign attribute is usable with the following element: <number:scientificnumber> 16.27.5. The number:forcedexponentsign attribute has the data type boolean 18.3.3.
Description
This relates to the comment received in https://lists.oasisopen.org/archives/officecomment/201407/msg00008.html
Currently the number:number element use a single attribute number:decimalplaces 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.
Currently the number:number element use a single attribute number:decimalplaces 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
A proposal to add the features requested here has been sent to the comment list:
https://lists.oasisopen.org/archives/officecomment/201504/msg00001.html
https://lists.oasisopen.org/archives/officecomment/201504/msg00002.html
https://lists.oasisopen.org/archives/officecomment/201504/msg00001.html
https://lists.oasisopen.org/archives/officecomment/201504/msg00002.html
Show
Michael Stahl (Inactive)
added a comment  A proposal to add the features requested here has been sent to the comment list:
https://lists.oasisopen.org/archives/officecomment/201504/msg00001.html
https://lists.oasisopen.org/archives/officecomment/201504/msg00002.html
Copied Laurent BallandPoirier's proposal from the attached ODT file to Proposal field.
Show
Michael Stahl (Inactive)
added a comment  Copied Laurent BallandPoirier's proposal from the attached ODT file to Proposal field.
convert schema change proposal to unified diff
Show
Michael Stahl (Inactive)
added a comment  convert schema change proposal to unified diff
As discussed in the call, there is a question if "exponentsign" is the best name for the attribute:
> The defined values for the number:exponentsign 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 "positiveexponentsign".
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.
> The defined values for the number:exponentsign 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 "positiveexponentsign".
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 (Inactive)
added a comment  As discussed in the call, there is a question if "exponentsign" is the best name for the attribute:
> The defined values for the number:exponentsign 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 "positiveexponentsign".
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.
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:decimalreplacement attribute is set to empty string. Number of decimal digits may vary from 0 to number:decimalplaces 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 MSOffice 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.
2 Rationale
2.1. Use cases:
Decimal number can have a variable number of decimal digits, if number:decimalreplacement attribute is set to empty string. Number of decimal digits may vary from 0 to number:decimalplaces 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 MSOffice 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 (Inactive)
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:decimalreplacement attribute is set to empty string. Number of decimal digits may vary from 0 to number:decimalplaces 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 MSOffice 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.
I note that Gnumeric uses gnm:forcedexponentsign. using forcedexponent sign may be better than positiveexponentsign=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 forcedsign or positivesign attribute.
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 forcedsign or positivesign attribute.
Show
Andreas Guelzow
added a comment  I note that Gnumeric uses gnm:forcedexponentsign. using forcedexponent sign may be better than positiveexponentsign=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 forcedsign or positivesign attribute.
a few cosmetic changes to proposal:
0 if number:decimalreplacement attribute is equal to empty string
=>
0 if the value of the number:decimalreplacement attribute is the empty string
it is set to the value of number:decimalplaces attribute.
=>
it is set to the value of the number:decimalplaces 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.
0 if number:decimalreplacement attribute is equal to empty string
=>
0 if the value of the number:decimalreplacement attribute is the empty string
it is set to the value of number:decimalplaces attribute.
=>
it is set to the value of the number:decimalplaces 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 (Inactive)
added a comment  a few cosmetic changes to proposal:
0 if number:decimalreplacement attribute is equal to empty string
=>
0 if the value of the number:decimalreplacement attribute is the empty string
it is set to the value of number:decimalplaces attribute.
=>
it is set to the value of the number:decimalplaces 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.
modified proposal to use "forcedexponentsign" instead of "exponentsign", as proposed by Andreas.
Show
Michael Stahl (Inactive)
added a comment  modified proposal to use "forcedexponentsign" instead of "exponentsign", as proposed by Andreas.
ok found it; in 2008 we removed all "a:defaultValue" from the Relax NG schema due to a comment from Murata Makoto.
https://wiki.oasisopen.org/office/proposal%3Adefaultvalues
> adapting the proposal to remove a:defaultValue
https://wiki.oasisopen.org/office/proposal%3Adefaultvalues
> adapting the proposal to remove a:defaultValue
Show
Michael Stahl (Inactive)
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.oasisopen.org/office/proposal%3Adefaultvalues
> adapting the proposal to remove a:defaultValue
I am not sure about the interaction between number:mindecimaldigits and number:decimaldigits. 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:mindecimaldigits=3 and number:decimaldigits=5? So do we have a restriction number:mindecimaldigits<=number:decimaldigits? If we do we should spell it out.
Perhaps we really mean something like number:optionaldecimaldigits=2 and number:decimaldigits=3 for 0.000##??
IN this case should number:mindecimaldigits=3 and number:decimaldigits=5? So do we have a restriction number:mindecimaldigits<=number:decimaldigits? If we do we should spell it out.
Perhaps we really mean something like number:optionaldecimaldigits=2 and number:decimaldigits=3 for 0.000##??
Show
Andreas Guelzow
added a comment  I am not sure about the interaction between number:mindecimaldigits and number:decimaldigits. 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:mindecimaldigits=3 and number:decimaldigits=5? So do we have a restriction number:mindecimaldigits<=number:decimaldigits? If we do we should spell it out.
Perhaps we really mean something like number:optionaldecimaldigits=2 and number:decimaldigits=3 for 0.000##??
Please look at the schema. The element "number:scientificnumber" gets an attribute "number:minexponentdigits" via reference "numberscientificnumberattlist" and another one via reference "commonmindecimaldigitsattlist"?
Show
Regina Henschel
added a comment  Please look at the schema. The element "number:scientificnumber" gets an attribute "number:minexponentdigits" via reference "numberscientificnumberattlist" and another one via reference "commonmindecimaldigitsattlist"?
Regina,thanks for checking...
"commonmindecimaldigitsattlist" does not add "number:minexponentdigits" but "number:mindecimaldigits", note "exponent" vs. "decimal".
"commonmindecimaldigitsattlist" does not add "number:minexponentdigits" but "number:mindecimaldigits", note "exponent" vs. "decimal".
Show
Michael Stahl (Inactive)
added a comment  Regina,thanks for checking...
"commonmindecimaldigitsattlist" does not add "number:minexponentdigits" but "number:mindecimaldigits", note "exponent" vs. "decimal".
so there are 2 different representations that are basically equivalent:
1. use number:decimalplaces to mean the total number of digits and new number:mindecimaldigits to mean that there is an optional suffix *of* that
2. use number:decimalplaces to mean the mandatory number of digits and new number:optionaldecimaldigits 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:mindecimaldigits attribute shall not be greater than the value of the number:decimalplaces attribute.“
1. use number:decimalplaces to mean the total number of digits and new number:mindecimaldigits to mean that there is an optional suffix *of* that
2. use number:decimalplaces to mean the mandatory number of digits and new number:optionaldecimaldigits 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:mindecimaldigits attribute shall not be greater than the value of the number:decimalplaces attribute.“
Show
Michael Stahl (Inactive)
added a comment  so there are 2 different representations that are basically equivalent:
1. use number:decimalplaces to mean the total number of digits and new number:mindecimaldigits to mean that there is an optional suffix *of* that
2. use number:decimalplaces to mean the mandatory number of digits and new number:optionaldecimaldigits 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:mindecimaldigits attribute shall not be greater than the value of the number:decimalplaces attribute.“
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:mindecimalplaces".
Proposal adapted accordingly.
Proposal adapted accordingly.
Show
Michael Stahl (Inactive)
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:mindecimalplaces".
Proposal adapted accordingly.
I think what we still need is a clear description how number:decimalplaces and number:mindecimalplaces interact and how they specify the formatting of the number. Before this change number:decimalplaces gave the number of decimal places used. With this change it apparently becomes the maximum number of decimal places shown while number:mindecimalplaces 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:decimalplaces and number:mindecimalplaces interact and how they specify the formatting of the number. Before this change number:decimalplaces gave the number of decimal places used. With this change it apparently becomes the maximum number of decimal places shown while number:mindecimalplaces 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).
To emphasize: the change as it is proposed now would give us:
The number:mindecimalplaces attribute specifies the minimum number of digits in the decimal part.
The number:decimalplaces attribute specifies the number of decimal places to display.
If number:mindecimalplaces is not equal to number:decimalplaces we need some explanatory text to say what the result for the number formatting should be.
The number:mindecimalplaces attribute specifies the minimum number of digits in the decimal part.
The number:decimalplaces attribute specifies the number of decimal places to display.
If number:mindecimalplaces is not equal to number:decimalplaces 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:mindecimalplaces attribute specifies the minimum number of digits in the decimal part.
The number:decimalplaces attribute specifies the number of decimal places to display.
If number:mindecimalplaces is not equal to number:decimalplaces we need some explanatory text to say what the result for the number formatting should be.
ok, how about this to document the interaction between the attributes:
"If the value of number:mindecimalplaces is less than the value of number:decimalplaces, trailing zero digits in decimal places following the position indicated by the value of number:mindecimalplaces shall not be displayed."
"If both number:decimalreplacement and number:mindecimalplaces attributes are present, and the number displayed is an integer, then the value of number:decimalreplacement shall be displayed."
is this sufficient?
"If the value of number:mindecimalplaces is less than the value of number:decimalplaces, trailing zero digits in decimal places following the position indicated by the value of number:mindecimalplaces shall not be displayed."
"If both number:decimalreplacement and number:mindecimalplaces attributes are present, and the number displayed is an integer, then the value of number:decimalreplacement shall be displayed."
is this sufficient?
Show
Michael Stahl (Inactive)
added a comment  ok, how about this to document the interaction between the attributes:
"If the value of number:mindecimalplaces is less than the value of number:decimalplaces, trailing zero digits in decimal places following the position indicated by the value of number:mindecimalplaces shall not be displayed."
"If both number:decimalreplacement and number:mindecimalplaces attributes are present, and the number displayed is an integer, then the value of number:decimalreplacement shall be displayed."
is this sufficient?
Proposal updated with previous comment.
Show
Michael Stahl (Inactive)
added a comment  Proposal updated with previous comment.
I think, that the schema can be more simple. (1) commondecimalplacesattlist is only used in numbernumber and numberscientificnumber. That is the same for the proposed commonmindecimalplacesattlist. Therefore this proposed part is not necessary, but its content can be merged into the commondecimalplacesattlist. (2) Attributes are always unordered in XML, therefore an "interleave" on attributes is superfluous. http://www.w3.org/TR/RECxml/#secstarttags
Proposal:
 OpenDocumentv1.2osschema.rng 20110929 01:00:00.000000000 +0200
+++ 3860v2schema.rng 20150705 19:49:55.047802100 +0200
@@ 12681,6 +12681,11 @@
<ref name="integer"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="number:forcedexponentsign">
+ <ref name="boolean"/>
+ </attribute>
+ </optional>
</define>
<define name="numberfraction">
<element name="number:fraction">
@@ 13194,6 +13199,11 @@
<ref name="integer"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="number:mindecimalplaces">
+ <ref name="integer"/>
+ </attribute>
+ </optional>
</define>
<define name="commonnumberattlist">
<interleave>
Proposal:
 OpenDocumentv1.2osschema.rng 20110929 01:00:00.000000000 +0200
+++ 3860v2schema.rng 20150705 19:49:55.047802100 +0200
@@ 12681,6 +12681,11 @@
<ref name="integer"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="number:forcedexponentsign">
+ <ref name="boolean"/>
+ </attribute>
+ </optional>
</define>
<define name="numberfraction">
<element name="number:fraction">
@@ 13194,6 +13199,11 @@
<ref name="integer"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="number:mindecimalplaces">
+ <ref name="integer"/>
+ </attribute>
+ </optional>
</define>
<define name="commonnumberattlist">
<interleave>
Show
Regina Henschel
added a comment  I think, that the schema can be more simple. (1) commondecimalplacesattlist is only used in numbernumber and numberscientificnumber. That is the same for the proposed commonmindecimalplacesattlist. Therefore this proposed part is not necessary, but its content can be merged into the commondecimalplacesattlist. (2) Attributes are always unordered in XML, therefore an "interleave" on attributes is superfluous. http://www.w3.org/TR/RECxml/#secstarttags
Proposal:
 OpenDocumentv1.2osschema.rng 20110929 01:00:00.000000000 +0200
+++ 3860v2schema.rng 20150705 19:49:55.047802100 +0200
@@ 12681,6 +12681,11 @@
<ref name="integer"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="number:forcedexponentsign">
+ <ref name="boolean"/>
+ </attribute>
+ </optional>
</define>
<define name="numberfraction">
<element name="number:fraction">
@@ 13194,6 +13199,11 @@
<ref name="integer"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="number:mindecimalplaces">
+ <ref name="integer"/>
+ </attribute>
+ </optional>
</define>
<define name="commonnumberattlist">
<interleave>
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>...onlyattributeshere...</interleave>
in the specification are actually unnecessary.
http://relaxng.org/spec20011203.html#fullsyntax
how does it work?
we start with
<define name="fooelem">
<element name="foo">
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<optional><attribute name="bar"/></optional>
<optional><attribute name="baz"/></optional>
</define>
apply "4.8. name attribute of element and attribute elements"
<define name="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<optional><attribute><name>bar</name></attribute></optional>
<optional><attribute><name>baz</name></attribute></optional>
</define>
apply "4.12. Number of child elements"
<define name="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<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="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<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="fooelem">
<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...
re (1): yes, this is obviously the case.
re (2): i agree this is possible, and all the existing
<interleave>...onlyattributeshere...</interleave>
in the specification are actually unnecessary.
http://relaxng.org/spec20011203.html#fullsyntax
how does it work?
we start with
<define name="fooelem">
<element name="foo">
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<optional><attribute name="bar"/></optional>
<optional><attribute name="baz"/></optional>
</define>
apply "4.8. name attribute of element and attribute elements"
<define name="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<optional><attribute><name>bar</name></attribute></optional>
<optional><attribute><name>baz</name></attribute></optional>
</define>
apply "4.12. Number of child elements"
<define name="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<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="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<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="fooelem">
<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 (Inactive)
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>...onlyattributeshere...</interleave>
in the specification are actually unnecessary.
http://relaxng.org/spec20011203.html#fullsyntax
how does it work?
we start with
<define name="fooelem">
<element name="foo">
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<optional><attribute name="bar"/></optional>
<optional><attribute name="baz"/></optional>
</define>
apply "4.8. name attribute of element and attribute elements"
<define name="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<optional><attribute><name>bar</name></attribute></optional>
<optional><attribute><name>baz</name></attribute></optional>
</define>
apply "4.12. Number of child elements"
<define name="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<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="fooelem">
<element>
<name>foo</name>
<ref name="barattr/>
</element>
</define>
<define name="fooattr">
<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="fooelem">
<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...
trying to set this one to RESOLVED, since we voted on it, see:
https://www.oasisopen.org/apps/org/workgroup/office/download.php/56463/ODFTCMinutes17August2015.txt
https://www.oasisopen.org/apps/org/workgroup/office/download.php/56463/ODFTCMinutes17August2015.txt
Show
Michael Stahl (Inactive)
added a comment  trying to set this one to RESOLVED, since we voted on it, see:
https://www.oasisopen.org/apps/org/workgroup/office/download.php/56463/ODFTCMinutes17August2015.txt
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:optionaldecimalplaces" attribute for the <number:number> element or some such ...