跳转至

22.7 附加特性

为了允许 Office Open XML 的制作者描述创建文档的特定上下文条件,可以使用下面定义的语法在“附加特性”部件中提供附加特性。

该组附加特性被设计为可扩展列表,并且可以为消费者提供有关如何解释文件的更多信息。 ECMA-376 定义了一组特性; 然而,可以创建额外的语法并通过词汇属性与唯一的 URI 关联。

Additional Characteristics

In order to allow producers of Office Open XML to describe specific contextual conditions under which the document was created, additional characteristics can be provided within the Additional Characteristics part using the syntax defined below.

The set of additional characteristics is designed to be an extensible list, and can provide a consumer with more information on how to interpret the file. ECMA-376 defines one set of characteristics; however, additional grammars can be created and associated with a unique URI via the vocabulary attribute.

22.7.1 目录

This subclause is informative.

  • [22.7.2] Elements
    • [22.7.2.1] additionalCharacteristics (Set of Additional Characteristics)
    • [22.7.2.2] characteristic (Single Characteristic)
  • [22.7.3] Simple Types
    • [22.7.3.1] ST_Relation (Characteristic Relationship Types)

End of informative text.

22.7.2 Elements

以下元素定义附加特性架构的内容:

Elements

The following elements define the contents of the Additional Characteristics schema:

22.7.2.1 additionalCharacteristics (附加特性集)

此元素是“附加特性”部件的根元素,包含 Office Open XML 文档的附加特性列表。

Example

“附加特性”部件中的以下内容将指定生成的电子表格应用程序支持 0 到 10,000 列,并且应相应地解释列范围:

<additionalCharacteristics>
    <characteristic name="numColumns" relation="le" val="10000"/>
    <characteristic name="numColumns" relation="ge" val="0"/>
</additionalCharacteristics>

Note

该元素内容模型 (CT_AdditionalCharacteristics) 的 W3C XML 模式定义位于 [§A.6.7]。

additionalCharacteristics (Set of Additional Characteristics)

This element is the root element of the Additional Characteristics part and contains the list of additional characteristics for an Office Open XML document.

Example

The following content in an Additional Characteristics part would specify that the producing spreadsheet application supports from 0 to 10,000 columns, and that column ranges should be interpreted accordingly:

<additionalCharacteristics>
    <characteristic name="numColumns" relation="le" val="10000"/>
    <characteristic name="numColumns" relation="ge" val="0"/>
</additionalCharacteristics>

Note

The W3C XML Schema definition of this element’s content model (CT_AdditionalCharacteristics) is located in [§A.6.7].

22.7.2.2 characteristic (单一特性)

该元素指定一个单一特性。 特性的类型由名称属性定义。

Example

生产者可以通知消费者,用于计算公式中存储的数字的计算属于由二进制尾数和指数的范围表示的值空间。 消费者可以选择检查这些特性以确定是否应该重新计算这些值。 其 XML 为:

<additionalCharacteristics>
    <characteristic name='precisionMantissa' relation='gt' val='-9007199254740992' />
    <characteristic name='precisionMantissa' relation='lt' val='9007199254740992' />
    <characteristic name='precisionExponent' relation='ge' val='-1075' />
    <characteristic name='precisionExponent' relation='le' val='970' />
</additionalCharacteristics>

属性 描述
name (特性名称) 指定特性的名称。 name 属性的值没有限制,但每个名称应通过词汇属性与特定词汇相关联.

ECMA-376 定义的值应与空词汇值相关联,如下所示:

名称 值 指定属性
numColumns 电子表格生成器支持的列数
numRows 电子表格生成器支持的行数.
functionVersion 使用的功能规范的版本
precisionMantissa 以 2 为基数表示时电子表格单元格/公式中数字尾数的允许值。
precisionExponent 以 2 为基数表示时电子表格单元格/公式中数字的指数的允许值。
numWorkbookColors 工作簿颜色数量
numConditionalFormatConditions 工作簿单元格上的条件格式条件数
nummaxSortLevels 范围或表的排序级别数
numAutoFilterItems 自动筛选下拉列表中显示的项目数
numDisplayCellChars 单元格中可显示的字符数
numPrintCellChars Excel 可以打印的每个单元格的字符数
numUnqiueCellStyles 工作簿中唯一单元格样式的数量(所有单元格格式的组合)
numFormulaLengthChars 公式长度(以字符为单位)
numFormulaNestingLeve1 公式嵌套层数
numFunctionArguments 函数的参数数量
numPivotTableRows 数据透视表中的行数
numPivotTableColumns 数据透视表中的列数
numUniquePivotFieldItems 数据透视字段中唯一项目的数量
numPivotTableMDXNameChars 数据透视表项目的 MDX 名称中的字符数
numPivotTableRelationChars 关系数据透视表的字符串长度
numPivotTableFieldLabelChars 数据透视表中字段标签的长度,包括标题长度限制
numPivotTableFields 数据透视表中的字段数
numSheetXRefArrayFormulas 工作表中可以引用另一个(给定)工作表的数组公式的数量
此属性的可能值由 W3C XML 架构字符串数据类型定义。
relation (值与名称的关系) 指定应如何在此特性的上下文中解释值属性的内容.

[Example: 以下内容将指定应用程序支持从 0 到 10,000 列,并且应相应地解释列范围:

<additionalCharacteristics>
<characteristic name="numColumns" relation="le" val="10000"/>
<characteristic name="numColumns" relation="ge" val="0"/>
</additionalCharacteristics>
end example]

该属性的可能值由 ST_Relation 简单类型 ([§22.7.3.1]) 定义。
val (特性值) 指定特性的值.

The possible values for this attribute are defined by the W3C XML Schema string datatype.

vocabulary (特性语法) 指定一个 URI,该 URI 定义了用于解释名称属性值的特性语法.

如果省略此属性,则应使用默认语法(如上面定义).

此属性的可能值由 W3C XML 架构 anyURI 数据类型定义.

[Note: 该元素内容模型 (CT_Characteristic) 的 W3C XML 模式定义位于 [§A.6.7]。 end note]

characteristic (Single Characteristic)

This element specifies a single characteristic. The type of characteristic is defined by the name attribute.

Example

A producer can inform the consumer that the computations used to calculate the stored numbers in the formulas belong to a value space expressed by ranges of the binary mantissa and exponent. A consumer can optionally check those characteristics to determine whether, for example, the values should be recalculated. The XML for this would be:

<additionalCharacteristics>
    <characteristic name='precisionMantissa' relation='gt' val='-9007199254740992' />
    <characteristic name='precisionMantissa' relation='lt' val='9007199254740992' />
    <characteristic name='precisionExponent' relation='ge' val='-1075' />
    <characteristic name='precisionExponent' relation='le' val='970' />
</additionalCharacteristics>

Attributes Description
name (Name of Characteristic) Specifies the name of the characteristic. There are no constraints on the value of the name attribute, but each name shall be associated with a specific vocabulary via the vocabulary attribute.

The values defined by ECMA-376 shall be associated with a null vocabulary value, and are as follows:

Name Value Property Specified
numColumns Number of Columns supported by the spreadsheet producer
numRows Number of Rows supported by the spreadsheet producer.
functionVersion Version of the function specification used
precisionMantissa Allowed values of the mantissa of numbers within spreadsheet cells/formulas when expressed in base 2.
precisionExponent Allowed values of the exponent of numbers within spreadsheet cells/formulas when expressed in base 2.
numWorkbookColors Number of Workbook colors
numConditionalFormatConditions Number of condition format conditions on a workbook cell
nummaxSortLevels Number of level of sorting on a range or table
numAutoFilterItems Number of items shown in the Auto-filter dropdown
numDisplayCellChars Number of characters that can display in a cell
numPrintCellChars Number of characters per cell that Excel can print
numUnqiueCellStyles Number of unique cell styles in a workbook (combinations of all cell formatting)
numFormulaLengthChars Length of formulas in characters
numFormulaNestingLeve1 Number of levels of formula nesting
numFunctionArguments Number of arguments to a function
numPivotTableRows Number of rows in a pivot table
numPivotTableColumns Number of columns in a pivot table
numUniquePivotFieldItems Number of unique items in a pivot field
numPivotTableMDXNameChars Number of characters in a MDX name for a pivot tableitem
numPivotTableRelationChars String length for a relationship pivot table
numPivotTableFieldLabelChars Length of field labels in PivotTable including caption length limitations
numPivotTableFields Number of fields in a pivot table
numSheetXRefArrayFormulas The number of array formulas in a worksheet that canrefer to another (given) worksheet
The possible values for this attribute are defined by the W3C XML Schema string datatype.
relation (Relationship of Value to Name) Specifies how the contents of the value attribute should be interpreted in the context of this characteristic.

[Example: The following would specify that the application supports from 0 to 10,000 columns, and that column ranges should be interpreted accordingly:
<additionalCharacteristics>
<characteristic name="numColumns" relation="le" val="10000"/>
<characteristic name="numColumns" relation="ge" val="0"/>
</additionalCharacteristics>
end example]

The possible values for this attribute are defined by the ST_Relation simple type (§22.7.3.1).
val (Characteristic Value) Specifies the value of the characteristic.

The possible values for this attribute are defined by the W3C XML Schema string datatype.

vocabulary (Characteristic Grammar) Specifies a URI defining the characteristic grammar with which the name attribute value shall be interpreted.

If this attribute is omitted, then the default grammar (as defined above) shall be used.

The possible values for this attribute are defined by the W3C XML Schema anyURI datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_Characteristic) is located in [§A.6.7]. end note]

22.7.3 简单类型

这是专用于附加特性的简单类型的完整列表.

Simple Types

This is the complete list of simple types dedicated to Additional Characteristics.

22.7.3.1 ST_Relation (特性关系类型)

这种简单类型指定特性的名称和值属性之间可能的关系.

此简单类型的内容是 W3C XML Schema 字符串数据类型的限制.

此简单类型仅限于下表中列出的值:

枚举值 描述
eq (Equal To) 等于
ge (Greater Than or Equal to) 大于或等于。
gt (Greater Than) 大于.
le (Less Than or Equal To) 小于或等于。
lt (Less Than) 小于.

[Note: 此简单类型的内容模型 (ST_Relation) 的 W3C XML 模式定义位于 [§A.6.7] 中。 end note]

ST_Relation (Characteristic Relationship Types)

This simple type specifies the possible relationships between a characteristic's name and value attributes.

This simple type's contents are a restriction of the W3C XML Schema string datatype.

This simple type is restricted to the values listed in the following table:

Enumeration Value Description
eq (Equal To) Equal to
ge (Greater Than or Equal to) Greater than or equal to.
gt (Greater Than) Greater than.
le (Less Than or Equal To) Less than or equal to.
lt (Less Than) Less than.

[Note: The W3C XML Schema definition of this simple type’s content model (ST_Relation) is located in [§A.6.7]. end note]


最后更新: 2024年4月11日
创建日期: 2024年4月11日