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 定义的值应与空词汇值相关联,如下所示:
|
||||||||||||||||||||||||||||||||||||||||||||||||
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:
|
||||||||||||||||||||||||||||||||||||||||||||||||
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日