共用方式為


Extension Class

Extension.When the object is serialized out as xml, its qualified name is x:ext.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Spreadsheet.Extension

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
Public Class Extension _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As Extension
public class Extension : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

[ISO/IEC 29500-1 1st Edition]

18.2.7 ext (Extension)

Each extension within an extension list shall be contained within an ext element. Extensions shall be versioned by namespace, using the uri attribute, and shall be allowed to appear in any order within the extension list. Any number of extensions shall be allowed within an extension list.

When extension lists are processed, a consumer might understand some extensions, and might not understand other extensions. The preservation model for extensions is that unprocessed extensions shall always be preserved (when consuming) and written out (when producing) in whole, as long as the underlying schema extended by the extension list remains. [Example: If a spreadsheetML sheet contains several extensions within an extension list, and through runtime processing that sheet is removed from the workbook, then the extensions associated with that sheet must not be written out when producing the resulting markup document. end example].

Markup namespaces within extensions shall not be required to be listed in the Ignorable Compatibility-Rule attribute, nor shall these namespaces be required to be listed in the PreserveElements and PreserveAttributes Compatibility-Rule attributes. [Note: See Part 3 for additional discussion on Application-Defined Extension Elements and processing rules. end note]

[Example:

In this example, there are two extensions written. The first extension describes a new structure that might have been defined by a fictitious second version of ISO/IEC 29500. The second extension describes a structure that might be introduced by a private party, developed independently from ISO/IEC 29500.

<extLst>
  <ext uri='https://schemas.openxmlformats.org/spreadsheetml/versionTwoExtension'>
    <v2:newContent xmln:v2='https://schemas.openxmlformats.org/spreadsheetml/versionTwoExtension'>
      …
    </v2:newContent>
  </ext>
  <ext uri='http://www.extension.com/versionOneExtension'>
    <v2:moreContent xmlsn:v2='http://www.extension.com/versionOneExtension'>
      …
    </v2:moreContent>
  </ext>
</extList>

end example]

Each extension has an uri attribute, which serves as an identifier to indicate information about the extension. [Note: For example, the uri might state the version of a markup specification to which the content conforms, or it might state the version of a producing application that wrote the content. end note] Upon encountering extensions, a processing consumer shall determine whether it knows how to process extensions using the value of the uri. If the consumer knows how to process such an extension, the markup contained within that extension is processed. Otherwise, the extension content shall be preserved so long as the underlying structure being extended by the extLst has not been removed.

Parent Elements

extLst (§18.2.10)

Child Elements

Subclause

Any element in any namespace

n/a

Attributes

Description

uri (URI)

A token to identify version and application information for this particular extension.

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

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

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Extension Members

DocumentFormat.OpenXml.Spreadsheet Namespace