12.2 Package Structure

12.2 Package Structure

A SpreadsheetML package shall contain a package-relationship item and a content-type item. The package- relationship item shall have implicit relationships with targets of the following type:

  • One Workbook part (12.3.23).

The package-relationship item

have

is permitted to

implicit relationships with targets of the following type:

  • Digital Signature Origin (15.2.7)
  • File Property parts (15.2.12) (Application-Defined File Properties,
  • Properties), as appropriate.
  • Thumbnail (15.2.16).

File

Core File Properties, and Custom

The required and optional relationships between parts are defined in 12.3 and its subordinate clauses.

[Example: The following package represents the minimal conformant SpreadsheetML package as defined by ISO/IEC 29500:

First, the content types for relationship parts, the Workbook part, and at least one Sheet part must be defined (physically located at /[Content_Types].xml in the package):

<Types xmlns="…">
  <Default Extension="rels"
    ContentType="application/vnd.openxmlformats-package.relationships+xml"
    />
  <Override PartName="/workbook.xml"
    ContentType="application/vnd.openxmlformats-officedocument.
    spreadsheetml.sheet.main+xml" />
  <Override PartName="/sheet1.xml"
    ContentType="application/vnd.openxmlformats-
    officedocument.spreadsheetml.worksheet+xml" />
</Types>

Next, the required package-level relationship to the Workbook part must be defined (physically located at /_rels/.rels in the package):

<Relationships xmlns="…">
  <Relationship Id="rId1"
    Type=http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument"
    Target="workbook.xml" />
</Relationships>

Next, the minimum content for the Workbook part must be defined (physically located at /workbook.xml in the package):

<workbook xmlns="…" xmlns:r="…">
  <sheets>
    <sheet name="1" sheetId="1" r:id="rId1" />
  </sheets>
</workbook>

Next, the required workbook-level relationship to the single Sheet part must be defined, (physically located at /_rels/workbook.xml.rels in the package):

<Relationships xmlns="…">
  <Relationship Id="rId1"
    Type="http://purl.oclc.org/ooxml/officeDocument/relationships/worksheet"
Target="sheet1.xml" />
</Relationships>

Finally, the minimum content for a single Sheet part must be defined (physically located at /sheet1.xml in the package):

<worksheet xmlns="…" xmlns:r="…">
  <sheetData />
</worksheet>

end example]

[Example: Consider a SpreadsheetML document that contains a workbook having three worksheets. Here’s an example of the hierarchical folder structure that might be used for the ZIP items in the package for that document. As shown, one part, Workbook (stored in the ZIP item /xl/workbook.xml), has its own relationship item:

/_rels/.rels
/[Content_Types].xml
/docProps/app.xml
/docProps/core.xml
/xl/workbook.xml
/xl/_rels/workbook.xml.rels
/xl/calcChain.xml
/xl/sharedStrings.xml
/xl/styles.xml
/xl/volatileDependencies.xml
/xl/theme/theme1.xml
/xl/worksheets/sheet1.xml
/xl/worksheets/sheet2.xml
/xl/worksheets/sheet3.xml

The package-relationship item contains the following:

<Relationships xmlns="…">
  <Relationship Id="rId3"
    Type="http://…/extended-properties" Target="docProps/app.xml"/>
  <Relationship Id="rId2"
    Type="http://…/core-properties" Target="docProps/core.xml"/>
  <Relationship Id="rId1"
    Type="http://…/officeDocument" Target="xl/workbook.xml"/>
</Relationships>

end example]

Last updated on