DR 16-0007 - SML: omissions and inconsistencies in the specification of attributes (Part 2)

Francis Cave francis at franciscave.com
Tue Aug 22 17:26:46 CEST 2017


Dear all

 

Corrected references to MS-OI29500 highlighted in yellow below.

 

Kind regards,

 

Francis

 

 

 

From: Francis Cave [mailto:francis at franciscave.com] 
Sent: 17 August 2017 17:05
To: 'SC 34 WG4' <e-SC34-WG4 at ecma-international.org>
Subject: DR 16-0007 - SML: omissions and inconsistencies in the
specification of attributes (Part 2)

 

Dear all

 

Here are proposed resolutions and actions for a further 12 elements in DR
16-0007.

 

Francis

 

 

§18.8.7 cellStyle (@name) (complex type: CT_CellStyle)

 

There is a note on this attribute in MS-OI29500 (limiting the name length –
see section 2.1.694, page 291, note a), but no mention of the attribute
being optional in the standard or how to interpret its omission.

 

I pointed out on 2016-08-08 that this issue relates to DR 16-0016. Any
further clarification of the prose will need to take account of the
resolution of DR 16-0016. 

 

On further reading of the current specification, and after running some
tests in Excel, I conclude that @name is optional because it is not required
if @builtinId is specified. . See Annex G.2 for a list of built-in style
names. If @builtinId is specified and @name is either omitted or has a value
other than the one specified in Annex G.2, Excel opens the document without
complaint and restores the correct built-in style name when the document is
saved. If both @builtinId and @name are omitted, Excel opens the document
without complaint and silently discards the unnamed style.

 

Proposed resolution: Add the following to the description of @name in prose:
“If this attribute and builtinId are both omitted, this cell style shall be
ignored.”

 

§18.8.34 rgbColor (@rgb) (complex type: CT_RgbColor)

 

There is no note on this attribute in MS-OI29500. 

 

The element rgbColor has only this one attribute and no content, so is
meaningless if the attribute is omitted. Yet the schema explicitly specifies
that the attribute is optional. The complex type CT_RgbColor is only used
for this element. I therefore conclude that there is a mistake in the
schema.

 

Proposed resolution: Change the schema to make this attribute required. No
change to prose.

 

§18.10.1.2 b (@cp, @f, @u) (complex type: CT_Boolean)

 

MS-OI29500, subsection 2.1.735 (page 320) includes the following notes:

 

a. The standard does not specify a default value for the u attribute.

 

Excel uses a default value of false for this attribute.

 

b. The standard does not specify a default value for the f attribute.

 

Excel uses a default value of false for this attribute.

 




 

e. The standard does not define the relation between the u attribute and the
sharedItems parent.

 

In Office, the u attribute only applies when the parent is sharedItems.

 

f. The standard does not define restrictions on when the cp attribute should
be present.

 

In Office, the cp attribute applies to OLAP-based PivotTables only and the
parent is sharedItems.

 

g. The standard does not specify restrictions on value of the cp attribute.

 

In Office, the value of the cp attribute shall be equal to the number of x
child elements and less than or equal to the mappingCount attribute of the
corresponding cacheField element.

 

h. The standard does not define the relation between the f attribute and the
sharedItems parent.

 

In Office, the f attribute only applies when the parent is sharedItems.

 

The attributes @f and @u indicate binary properties of an item in a
PivotTable: is a calculated item or not; is an unused item or not. Omitting
the attribute would logically imply that these properties don’t apply to the
item, so I conclude that Excel’s usage is the only logical usage and should
be documented in the standard.

 

Should some of the Excel restrictions on the use of @cp, @f and @u be
documented in the standard, or are they implementation-specific?

 

The complex type CT_Boolean in SpreadsheetML is only used for this element,
but this element appears in content models defined by the following complex
types:

 

*	CT_GroupItems
*	CT_Record
*	CT_SharedItems

 

MS-OI29500 states that @cp is only used by Office in sharedItems
(§18.10.1.90). Strangely, it is only groupItems (§18.10.1.38) that
explicitly mentions OLAP. There are no examples in the standard of the use
of @cp, although it is available on six SpreadsheetML elements: b, d, e, m,
n and s. Judging by the notes on these elements in MS-OE376, the usage of
@cp varies according to the element, so examples in each case would be
useful to promote interoperability.

 

Proposed resolution: Add the default value false to the schema for both @f
and @u. Provide an example of the use of @cp on at least one of the six
elements on which it is available.

 

§18.10.1.8 calculatedItem (@formula) (complex type: CT_CalculatedItem)

 

There is a note on this attribute in MS-OI29500 (limiting the maximum value
– see section 2.1.741, page 324, note c), but no mention of the attribute
being optional in the standard or how to interpret its omission.

 

This element specifies a formula associated with a specific PivotTable
field. It does not make any sense for the PivotTable field not to be
specified. However, the presence of extLst in the complex type
CT_CalculatedItem suggests that there might be other ways in which
associated the PivotTable field could be determined.

 

Proposed action: Ask the Excel team to clarify under what circumstances
@field can be omitted. Depending upon their response, decide whether or not
to change prose or change the schema to make this attribute required.

 

§18.10.1.21 d (@cp, @f, @u) (complex type: CT_DateTime)

 

MS-OI29500, subsection 2.1.748 (page 326) includes the following notes:

 

a. The standard does not specify a default value for the u attribute.

 

Excel uses a default value of false for this attribute.

 

b. The standard does not specify a default value for the f attribute.

 

Excel uses a default value of false for this attribute.

 




 

e. The standard does not define the relationship between the cp attribute
and the datasource type.

 

In Office, the cp attribute applies to OLAP-based PivotTables only.

 

f. The standard does not define the relation between the cp attribute and
the sharedItems parent.

 

In Office, the cp attribute applies when the parent is sharedItems.

 

g. The standard does not define the relation between @f and the sharedItems
parent.

 

In Office, @f applies when the parent is sharedItems.

 

h. The standard does not define restrictions on the value of @cp.

 

In Excel, @cp shall be equal to the count of child x elements and be less
than or equal to the @mappingCount of the corresponding cacheField element.

 

i. The standard does not define the relation between @u and the sharedItems
parent.

 

In Excel, @u applies when the parent is sharedItems.

 

See discussion above for §18.10.1.2 b. 

 

Proposed resolution: Add the default value false to the schema for both @f
and @u. Provide an example of the use of @cp on at least one of the six
elements on which it is available.

 

§18.10.1.27 e (@bc, @cp, @f, @fc, @in, @u) (complex type: CT_Error)

 

MS-OI29500, subsection 2.1.752 (pages 327–328) includes the following notes:

 

c. The standard does not define the relation between the cp attribute and
child elements.

 

In Office, the value of the cp attribute shall be equal to the count of
child elements and be less than or equal to the @mappingCount of the
corresponding cacheField element.

 

d. The standard does not define the relation between the cp attribute and
the datasource type.

 

In Office, the cp attribute applies only to OLAP-based PivotTables.

 

e. The standard does not define relation between the cp attribute and
sharedItems node.

 

In Office, the cp attribute applies only when the node parent is
sharedItems.

 

f. The standard does not specify a default value for the f attribute.

 

Excel uses a default value of false for this attribute.

 

g. The standard does not specify a default value for the u attribute.

 

Excel uses a default value of false for this attribute.

 




 

i. The standard does not define relation between the f attribute and
sharedItems node.

 

In Office, the f attribute applies only when the node parent is sharedItems.

 

j. The standard does not define relation between the u attribute and
sharedItems node.

 

In Office, the u attribute applies only when the node parent is sharedItems.

 

Regarding attributes @cp, @f and @u, see discussion above for §18.10.1.2 b. 

 

Regarding attributes @bc (Background Color) and @fc (Foreground Color), no
default value can be given, because one would expect the defaults in these
cases to be controlled by the application.

 

Regarding the attribute @in (Format Index), this clearly only applies if the
format string for this entry in the PivotTable is stored in an OLAP
serverformat (§18.10.1.86) element.

 

Proposed resolution: Add the default value false to the schema for both @f
and @u. Provide an example of the use of @cp on at least one of the six
elements on which it is available. No action for the other attributes.

 

§18.10.1.45 item (@x) (complex type: CT_Item)

 

MS-OI29500, subsection 2.1.764 (page 332) includes the following notes:

 

k. The standard restricts the x attribute to non-OLAP PivotTables only.

 

Excel allows the x attribute in both OLAP and non-OLAP PivotTables.

 




 

m. The standard does not specify when the x attribute is required.

 

Excel requires the x attribute when the value of the t attribute is data.

 

n. The standard states that the x attribute specifies an index to an item in
the pivotFields collection.

 

Excel uses the x attribute to specify an index to an item in the sharedItems
collection for this pivotField.

 

There no mention of OLAP in the description of the attribute @x for this
element in the standard, so note k above can be ignored.

 

Should note m be documented in the standard? The value data is the default
value for @t, so it might be useful to document that @x is required if @t is
either omitted or has the value data.

 

Note n does not quite agree with the current description of @x in the
standard, which states that @x “specifies the item index in pivotFields
collection in the PivotCache”. But §18.10.1.67 suggests that a PivotCache in
fact contains cacheFields, not pivotFields.

 

Further exploration of the normative text in §18.10 Pivot Tables tends to
lead to more confusion. For example, in §18.10.1.46 there is an example
which is unintelligible, until one realises that it relates to a longer
example in §L.2.9 in the Primer. However, this doesn’t completely resolve
the confusion: for example, a value “Adam L Flores” is referred to in
§18.10.1.46 and in §L.2.9.3.4.3, but is not included in the example
pivotCacheDefinition in §L.2.9.3.2.

 

Proposed action: A thorough review of Pivot Table normative text and Primer
material is needed to clarify how to implement Pivot Tables in
SpreadsheetML, which might well lead to a need for more wholesale revision
of §18.10 and §L.2.9. Tinkering with the description of attribute values
here and there will not suffice.

 

§18.10.1.50 m (@bc, @cp, @f, @fc, @in, @u) (complex type: CT_Missing)

 

MS-OI29500, subsection 2.1.768 (page 335) includes the following notes:

 

c. The standard does not specify a default value for the f attribute.

 

Excel uses a default value of false for this attribute.

 

d. The standard does not define the relation between @cp and child elements.

 

In Office, the value of @cp shall be equal to the count of child x elements
and be less than or equal to the @mappingCount of the corresponding
cacheField element.

 

e. The standard does not define the relation between @cp and the datasource
type.

 

In Office, @cp applies only to OLAP-based PivotTables.

 

f. The standard does not define relation between @cp and sharedItems node.

 

In Office, @cp applies only when the node parent is sharedItems.

 

g. The standard does not specify a default value for the u attribute.

 

Excel uses a default value of false for this attribute.

 

h. The standard does not define relation between @f and sharedItems node.

 

In Office, @f applies only when the node parent is sharedItems.

 

i. The standard does not define relation between @u and sharedItems node.

 

In Office, @u applies only when the node parent is sharedItems.

 

Regarding attributes @cp, @f and @u, see discussion above for §18.10.1.2 b. 

 

Regarding attributes @bc, @fc and @in, see discussion above for §18.10.1.27
e.

 

Proposed resolution: Add the default value false to the schema for both @f
and @u. Provide an example of the use of @cp on at least one of the six
elements on which it is available. No action for the other attributes.

 

§18.10.1.51 map (@dimension, @measureGroup) (complex type:
CT_MeasureDimensionMap)

 

MS-OI29500, subsection 2.1.769 (pages 335–336) includes the following notes:

 

a. The standard does not place any restrictions on the value of the
measureGroup attribute.

 

In Office, the value of the measureGroup attribute must be less than the
number of items in measureGroups collection.

 

b. The standard does not restrict the value of @dimension.

 

In Office, @dimension must be less than number of items the dimensions
collection.

 

c. The standard does not specify the base of the dimension attribute index.

 

Office treats the dimension attribute as a zero-based index.

 

d. The standard does not specify the base of the measureGroup attribute
index.

 

Office treats the measureGroup attribute as a zero-based index.

 

e. The standard states that the dimension attribute is optional.

 

Excel requires this attribute.

 

f. The standard implies that the measureGroup attribute is optional.

 

Excel requires this attribute.

 

The element has these two attributes and no content. There seems no point in
having the element without specifying the two elements that are being
mapped/associated: a map and a measureGroup. It would seem to be a mistake
in the schema that these attributes are declared to be optional.

 

Proposed resolution: Change the schema to make these two attributes
required. No change to the prose.

 

§18.10.1.60 n (@bc, @cp, @f, @fc, @in, @u) (complex type: CT_Number)

 

MS-OI29500, subsection 2.1.775 (page 338) includes the following notes:

 

a. The standard does not define relation between @cp and the datasource
type.

 

Office allows @cp only with OLAP PivotTables.

 




 

d. The standard does not specify a default value for the u attribute.

 

Excel uses a default value of false for this attribute.

 

e. The standard does not restrict the value of @cp.

 

Office requires that @cp be equal to the count of child x elements and be
less than or equal to the mappingCount of the corresponding cacheField
element.

 

f. The standard does not specify a default value for the f attribute.

 

Excel uses a default value of false for this attribute.

 




 

h. The standard does not state when @f is valid.

 

In Office, @f is valid only when the parent of the n element is of
CT_SharedItems type.

 

i. The standard does not define relation of @u with CT_SharedItems node.

 

In Office, @u is used only when the n element's parent is of CT_SharedItems
type.

 




 

k. The standard does not place a restriction for on the value of the cp
attribute.

 

In Office, the cp attribute applies only when the node parent is
sharedItems.

 

Notes f and q appear to answer the same question, but in different ways. Are
both correct?

 

Regarding attributes @cp, @f and @u, see discussion above for §18.10.1.2 b. 

 

Regarding attributes @bc, @fc and @in, see discussion above for §18.10.1.27
e.

 

Proposed resolution: Add the default value false to the schema for both @f
and @u. Provide an example of the use of @cp on at least one of the six
elements on which it is available. No action for the other attributes.

 

§18.10.1.74 pivotTableStyleInfo (@showColHeaders, @showColStripes,
@showLastColumn, @showRowHeaders, @showRowStripes) (complex type:
CT_PivotTableStyle)

 

MS-OI29500, subsection 2.1.785 (page 348) includes the following notes:

 

a. The standard defines the @showLastColumn to determine if the last column
of formatting is shown.

 

Office ignores this attribute.

 

b. The standard does not specify a default value for the showRowHeaders
attribute.

 

Excel uses a default value of 0 for this attribute.

 

c. The standard does not specify a default value for the showRowStripes
attribute.

 

Excel uses a default value of 0 for this attribute.

 

d. The standard does not specify a default value for the showColStripes
attribute.

 

Excel uses a default value of 0 for this attribute.

 

e. The standard does not specify a default value for the showColHeaders
attribute.

 

Excel uses a default value of 0 for this attribute.

 

Given that Excel ignores @showLastColumn, it probably makes sense for the
default value to be false.

 

Since all the other attributes have Boolean values, it would make sense for
their omission to imply a default value false. One might be able to conceive
of a more limited implementation in which a default value true might be
appropriate, but this seems unlikely.

 

Proposed resolution: For clarity, add use=“optional” to the schema attribute
declarations for @showColHeaders, @showColStripes, @showRowHeaders and
@showRowStripes. Add default=“false” to all five attribute declarations.

 

§18.10.1.85 s (@bc, @cp, @f, @fc, @in, @u) (complex type: CT_String)

 

MS-OI29500, subsection 2.1.791 (pages 351–352) includes the following notes:

 

a. The standard does not specify a default value for the u attribute.

 

Excel uses a default value of false for this attribute.

 

b. The standard does not specify a default value for the f attribute.

 

Excel uses a default value of false for this attribute.

 




 

e. The standard does not state that @cp is required in certain cases.

 

Office requires that @cp shall be equal to the count of child x elements and
be less than or equal to the @mappingCount of the corresponding cacheField
element.

 

f. The standard does not state that the presence of @cp is related to the
datasource type.

 

In Office, @cp is specific to OLAP-based PivotTables.

 

g. The standard does not define a relationship between @cp and the parent
element of s.

 

In Office, @cp applies only when the parent of the s element is of type
CT_SharedItems.

 

h. The standard does not define a relationship between @f and the parent
element of s.

 

In Office, @f applies only when the parent of the s element is of type
CT_SharedItems.

 

i. The standard does not define a relationship between @u and the parent
element of s.

 

In Office, @u applies only when the parent of the s element is of type
CT_SharedItems.

 

Regarding attributes @cp, @f and @u, see discussion above for §18.10.1.2 b. 

 

Regarding attributes @bc, @fc and @in, see discussion above for §18.10.1.27
e.

 

Proposed resolution: Add the default value false to the schema for both @f
and @u. Provide an example of the use of @cp on at least one of the six
elements on which it is available. No action for the other attributes.

 

 

ELEMENTS IN DR 16-0007 NOT YET CONSIDERED

 

The following 9 elements in the DR have yet to be considered:

 

§18.10.1.86 serverFormat (@culture, @format) (complex type: CT_ServerFormat)

 

§18.10.1.92 tpl (@fld, @hier) (complex type: CT_Tuple)

 

§18.13.1 connection (@name, @type) (complex type: CT_Connection)

 

§18.13.3 dbPr (@command) (complex type: CT_DbPr)

 

§18.13.5 olapPr (@rowDrillCount) (complex type: CT_OlapPr)

 

§18.13.12 textPr (@characterSet) (complex type: CT_TextPr) – the attribute
@codePage was moved to Part 4, but is still mentioned here and in §18.2.24
webPublishing.

 

§18.13.13 webPr (@url) (complex type: CT_WebPr)

 

§18.14.1 cell (@r) (complex type: CT_ExternalCell)

 

§18.14.15 definedName (@refersTo) (complex type: CT_ExternalDefinedName)

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.vse.cz/pipermail/sc34wg4/attachments/20170822/4d5da800/attachment-0001.html>


More information about the sc34wg4 mailing list