tag. The tr element acts
as a container for a row of cells with the table’s content.
A tr element has one formatting child element, trPr, which defines the row properties (such as the
row’s width) and whether it can split across a page. Each property is defined by an individual child
element under the trPr element. The complete set of table row properties can be found on the
definition for the trPr element. As well, a table row can contain two kinds of content: custom markup
(custom XML or structured document tags), and table cells.
The cells in a row contain the table’s content and are defined by tc elements, which are analogous to
HTML | tags.
A tc element has one formatting child element, tcPr, which defines the properties for the cell. Each
unique property is specified by a child element of this element. The complete set of table cell properties
can be found on the definition for the tcPr element. As well, a table cell can contain any valid block-level
content, as defined by the WordprocessingML schema, which allows for the nesting of paragraphs and
tables within table cells.
In the example below, the tcW element defines the width of the cell, where the attribute w is the value
in twips. Here the width of the cell is 8,856 units, where units are defined by the attribute type. In this
case, dxa represents twips.
ECMA-376 Part 1
The tc element contains the cell's content, which, in this case, is an empty p element.
Consider a table having one cell, which contains the text “Hello, world”:
Hello, world
This table's content is represented by the following XML:
Hello, world
At both the row and cell levels, the properties must also specify how the rows and cells are placed on
the table grid.
The trPr element contains information about the number of grid units which should be omitted
('skipped') before and after the row is complete using the gridBefore and gridAfter elements, allowing
rows to start at different columns on the grid, as well as a preferred width for that leading/trailing space
using the wBefore and wAfter elements. The tcPr element also contains grid information pertaining to
how many grids a cell spans using the gridSpan element, which determines how many grid units are
consumed by the current cell, as well as a preferred width for that cell using the tcW element.
In the earlier complex table having two rows of two differently sized cells, a consumer must represent
that table containing three grid columns (one per distinct vertical line). Consider the following XML for
the first row of that table:
Annex L
Again, the gridSpan element is the number of grid columns that cell spans when being laid out on the
table grid. In this example, the first cell of the first row contains two grid columns. As well, the cell
specifies its preferred width using the tcW element, which tells the consumer the width desired by that
cell at layout time.
It is important to note that every width in a table is a preferred width - because the table must satisfy
the grid at all times, conflicting table properties must be resolved by overriding preferred widths in a
specific manner, shown below.
L.1.5.5 Table Layout
Given the information shown in the table shown above, the table is specified as a series of properties:
Table-level properties (e.g., preferred width)
Table column grid
Row-level properties (e.g., grid units before/after row start/end)
Cell-level properties (e.g., number of grid units spanned)
In order to manipulate this set of properties into a table, the following logics are used, depending on the
type of table:
L.1.5.6 Fixed Width Tables
The first type of table is a fixed width table, a table that does not dynamically resize based on its
contents. In a fixed width table, the table information is used in the following manner:
The table grid is used to create the set of shared columns in the table and their initial widths as
defined in the tblGrid element
The table’s total width is defined based on the tblW property – if it is set to auto or nil, then
the width is not yet determined and is specified using the row and cell information.
ECMA-376 Part 1
The first table row is read and the initial number of grid units before the row starts is skipped.
The width of the skipped grid columns is set using the wBefore property.
The first cell is placed on the grid, and the width of the specified grid column span set by
gridSpan is set based on the tcW property.
Each additional cell is placed on the grid.
If at any stage, the preferred width requested for the cells exceeds the preferred width of the
table, then each grid column is proportionally reduced in size to fit the table width.
If the grid is exceeded (e.g., tblGrid specifies three grid columns, but the second cell has a
gridSpan of three), the grid is dynamically increased with a default width for the new grid
column.
For each subsequent row, cells are placed on the grid, and each grid column is adjusted to be
the maximum value of the requested widths (if the widths do not agree) by adding width to the
last cell that ends with that grid column. Again, if at any point, the space requested for the cells
exceeds the width of the table, then each grid column is proportionally reduced in size to fit the
table width.
L.1.5.7 AutoFit Tables
In an AutoFit table (one which specifies that it should “AutoFit to table contents”), the table information
is used in the following manner:
Perform the steps above to lay out the fixed width version of the table.
Calculate the minimum content width - the width of the cell's contents including all possible line
breaking locations (or the cell's width, if the width of the content is smaller), and the maximum
content width -the width of the cell's contents (assuming no line breaking not generated by
explicit line breaks).
The minimum and maximum content width of all cells that span a single grid column is the
minimum and maximum content width of that column.
For cells which span multiple grid columns, enlarge all cells which it spans as needed to meet
that cell's minimum width.
If any cell in a grid column has a preferred width, the first such width overrides the maximum
width of the column's contents.
Place the text in the cells in the table, respecting the minimum content width of each cell's
content. If a cell's minimum content width exceeds the cell's current width, preferences are
overridden as follows:
First, override the column widths by making all other grid columns proportionally smaller until
each it at its minimum width. This cell can then grow to any width between its own minimum
and maximum width.
Next, override the preferred table width until the table reaches the page width.
Finally, force a line break in each cell's contents as needed
Annex L
L.1.5.8 Complex Table Example
The properties above are best illustrated by example:
As shown above, table cells can be merged horizontally. This is represented with a single table cell
whose gridSpan property defines the number of grid units consumed by that table cell for the current
row. Consider the following fixed width table, which makes extensive use of resized and merged cells on
what is actually just a seven-column grid. (The arrows point to each (invisible) vertical line of the grid
and the numbers refer to the grid columns):
1 2 3 4 5 6 7
Although the table is visually complex, the standard rules apply: the first cell in the table is simply a cell
which spans four grid units horizontally, as specified in the gridSpan element, and whose preferred with
is 2952 twips, specified in the tcW element:
Similarly, all cells indented from the stand and end of the grid specify that indent using the gridBefore
and gridAfter elements. For example, the XML for the second row in the table shows that that row
starts three grid units into the table:
…
If we take this fixed width table and introduce a long string into the single cell in row 3, we see that the
presence of this text does not affect cell widths:
ECMA-376 Part 1
longte
xtstrin
gwithn
obreak
ingcha
racters
If we now turn on the AutoFit property and insert text into the cell in row three, which spans only grid
column two, we see that the algorithm for this AutoFit table causes all cells in grid column two to
increase in size, proportionally decreasing the other grid columns’ size to accommodate the long non-
breaking string in the last cell:
longtextstringwithnobreakingcharacters
Each of the other grid columns was reduced, but since all columns are not at their minimum size, the
table width is not increased even though the table is not yet at the page width.
L.1.5.9 Vertically Merged Cells
Although the previous examples might have implied that tables have strict definition of rows, table cells
can also be merged vertically. The tcPr element can contain the vMerge element that defines the extent
of vertically merged grid columns within a table. A vMerge element with its val attribute set to
restart marks the start of a vertically merged cell range. A vMerge element with the val attribute set
to continue (the default value) marks the continuation of a vertically merged grid column. Cells
between the first and last merged cell that are part of the vertical merge each must have a vMerge
element to continue the vertical merge.
For example, consider a table with two rows and two columns:
First cell, first row Last cell, first row
First cell, second row Last cell, second row
Annex L
Merging the two rows in the second column results in the following table:
First cell, first row Last cell, first row
Last cell, second row
First cell, second row
The last cell in the first row starts a merge that is completed in the cell below it, resulting in the
following WordprocessingML:
First cell, first row
Last cell, first row
Last cell, second row
First cell, second row
ECMA-376 Part 1
As shown, the vMerge with a value of restart begins (or restarts) a merged region, and the cell with
no value is merged with the one above.
L.1.6 Custom Markup
There are three distinct forms in which extra-standard semantics can be inserted into a
WordprocessingML document, each with their own specific intended usage:
Smart tags
Custom XML markup
Structured document tags (content controls)
The usage and presentation of each of these forms is described in the following sections.
L.1.6.1 Smart Tags
The first form of extra-standard semantics that can be embedded in a WordprocessingML document are
smart tags. Smart tags allow semantic information to be added around an arbitrary run or set of runs
within a document to provide information about the kind of data contained within.
Consider the following text in a WordprocessingML document, with a smart tag around the stock symbol
'CNTS' (where the smart tag is displayed using a purple dotted underline):
This is a stock symbol: CNTS
This text would translate to the following WordprocessingML markup:
This is a stock symbol:
MSFT
Annex L
As shown above, the smart tag is delimited by the smartTag element, which surrounds the run (or runs)
which contain the text which is part of the smart tag.
The smart tag itself carries two required pieces of information, which together contain the customer
semantics for this smart tag.
The first of these is the namespace for this smart tag (contained in the uri attribute). This allows the
smart tag to specify a URI which should be round-tripped with this smart tag and be available to a
consumer. It is intended to be used to specify a family of smart tags to which this one belongs – for
example, in the sample above, the smart tag belongs to the http://purl.oclc.org/ooxml/smartTags
namespace.
The second of these is the element name for this smart tag (contained in the element attribute). This
allows the smart tag to specify a name which should be round-tripped with this smart tag and again
available to a consumer. It is intended to be used to specify a unique name for this class of smart tag –
for example, in the sample above, the smart tag specifies that its data is of class stockticker.
As well as the required information specified above, a smart tag can also contain any number of
additional properties in namespace/name/value sets by adding them to the smart tag’s property bag.
Using the example above, adding a new property called fullCompanyName with no namespace and
value Microsoft Corporation to the smart tag would mean augmenting the output to add the
smartTagPr element with this new property as follows:
MSFT
The resulting XML, as seen above, simply adds an attr element which specifies the property and value
for the property bag.
A producer can embed a smart tag around any run-level content in a WordprocessingML document in
order to embed additional information about the family and class of the data contained within. This
allows ‘tagging’ of specific regions of a document with these semantics without need to provide context
beyond the information provided in the uri and element attributes.
A consumer can read this smart tag data and provide additional functionality around these
namespace/element pairs, which might or might not be specific to that smart tag class in the document.
ECMA-376 Part 1
Examples of this functionality include: the ability to add/remove this markup via a user interface, ability
to provide actions to operating in the context of this data classification, etc.
L.1.6.2 Custom XML Markup
The next form of extra-standard semantics that can be embedded in a WordprocessingML document is
custom XML markup. Custom XML markup allows the application of the XML elements defined in any
valid XML Schema file to be applied to the contents of a WordprocessingML document in one of two
locations: around a paragraph or set of paragraphs (at the block level); or around an arbitrary run or set
of runs within a document (at the inline level) to provide semantics to that content within the context
and structures defined by the associated XML Schema definition file.
The distinction between custom XML markup and smart tags is based on the fact that custom XML
markup corresponds with the contents of a custom XML schema; which means that as shown below,
custom XML markup can be used at the block-level to mark up the contents of a document on levels
beyond that of one or more runs as well as on the inline (run) level. It can also be validated against a
custom XML schema by a producer at run time.
Consider a simple XML Schema which defines two elements: a root element of invoice, and a child
element of customerName - the first defining that this file's contents are an invoice, and the second
specifying that the enclosed text as a customer's name:
This output would translate to the following WordprocessingML markup:
Annex L
This is an invoice.
And this is a customer name:
Tristan Davis
As shown above, each of the XML elements from the customer-supplied XML schema is represented
within the document output as a customXml element.
Similar to the smart tag example above, a custom XML element in a document has two required
attributes.
The first is the uri attribute, whose contents specify the namespace of the custom XML element in the
document. In the example above, the elements each belong to the
http://www.example.com/2006/invoice namespace.
The second is the element attribute, whose contents specify the name of the custom XML element at
this location in the document. In the example above, the root element is called invoice and the child
element is called customerName.
As well as the required information specified above, custom XML elements can also specify any number
of attributes (as specified in the associated XML Schema) on the element. To add this information, the
customXmlPr (properties on the custom XML element) specify one or more attr elements.
Using the example above, we can add a type attribute to the customerName element as follows:
ECMA-376 Part 1
Tristan Davis
The resulting XML, as seen above, simply adds an attr element which specifies the attribute for the
custom XML element.
A producer can embed a custom XML element around or with block-level or run-level content in a
WordprocessingML document in order to embed the structure of the extra-standard XML Schema within
the WordprocessingML content. This allows ‘tagging’ of specific regions of a document with the
semantics from this schema, while ensuring that the resulting file can be validated to the
WordprocessingML schemas.
A consumer can read this custom XML markup and provide additional functionality around this extra-
standard XML markup, which might or might not be specific to that particular XML namespace.
Examples of this functionality include: the ability to add/remove this XML markup via a user interface,
ability to provide actions to operating in the context of this namespace, etc.
Each custom XML element is analogous to an XML element in the specified XML schema, and can be
nested arbitrarily to any depth in the document. This facility is limited only by the XML Schema file itself,
and the contents of the current document.
L.1.6.3 Structured Document Tags
The final form of extra-standard semantics that can be embedded in a WordprocessingML document is
the structured document tag (SDT).
As shown above, smart tags and custom XML markup each provide a facility for embedding customer-
defined semantics into the document: smart tags, via the ability to provide a basic namespace/name for
a run or set of runs within a documents; and custom XML markup, via the ability to tag the document
with XML elements and attributes specified by any valid XML Schema file.
However, each of these techniques, while they each provide a way to add the desired semantic
information, does not provide a way to affect the presentation or interaction within the document. To
bridge these two worlds, structured document tags allow both the specification of customer semantics
as well as the ability to influence the presentation of that data in the document.
Annex L
This means that the customer can define the semantics and context of the tag, but can then use a rich
set of pre-defined properties to define its behavior and appearance within the WordprocessingML
document's presentation.
Consider a region which should be tagged with the semantic of "birthday", for the user to enter their
date or birth into the document. Ideally, this region would also utilize a date picker to allow the user to
enter the date from a calendar::
This content would translate to the following WordprocessingML markup:
Click here to enter a date…
As shown above, each of the structured document tags in the WordprocessingML file is represented
using the sdt element.
ECMA-376 Part 1
Within a structured document tag, there are two child elements which contain the definition and the
content of this SDT. The first of these is the sdtPr element, which contains the set of properties
specified for this structured document tag. The second is the sdtContent element, which contains all the
content which is contained within this structured document tag.
L.1.6.3.1 Structured Document Tag Properties
Within the SDT’s properties, various properties can be set which affect the appearance and behavior of
this content in the document. These properties can be divided into four groups:
Shared properties
Locking properties
Structured document tag type
Structured document tag type-specific properties
The complete set of properties for a structured document tag (SDT) are found on the sdtPr element.
The first group is properties shared by all types of SDTs. These include, but are not limited to, the
semantic name for the SDT, a unique ID (as an integer) that is round-tripped and allows the control to be
uniquely identified across sessions, and a reference to a document building block that should be
displayed as placeholder text.
The next group is the locking properties for the tag – these specify whether any consumer should allow
the contents of the SDT to be edited, or the SDT itself to be deleted from the document.
The next group, the structured document tag’s type, specifies how the content should be expressed in a
document. These include: plain text (all contents are of one formatting), rich text, date picker, combo
box, drop-down list, and image. Each of the SDT types provides user interface restrictions that restrict
the contents to only those specified by the SDT type (e.g., the picture cannot contain text).
Finally, the SDT type-specific properties contain properties that are sensible in the context of that type.
For example, the date format for a date picker or the drop-down list entries for a drop-down list/combo
box. SDT type-specific properties are stored as children of the type’s element.
Referring to the example above, the date properties are stored underneath the date element, as
follows:
…
This ensures that these properties are only available in the appropriate context(s).
Annex L
L.1.6.3.2 Structured Document Tag Content
The second child of the sdt element is the sdtContent element, which contains all the content which is
contained within this structured document tag.
L.1.6.3.3 XML Mapping
An additional property for SDTs allows their contents to be stored in another part (in particular, in the
custom XML data storage within the file). The presence of the dataBinding element specifies that the
contents of this SDT are simply a cache of the data stored at a particular XML element in a particular
custom XML data storage part.
L.1.7 Sections
Within the main document story, there is also often a need for groupings of content on a basis larger
than a paragraph (for example, ensuring that a specific set of paragraphs and tables are printed in
landscape view, while ensuring that the remainder of the document is printed in portrait view). In order
to group this content, a document can be divided into multiple sections, each of which defines a region
of content in the document and allows the application of a set of section-level properties.
Consider a WordprocessingML document with two paragraphs of content, the first of which should be
displayed on a page printed in portrait view, and the second of which should be displayed on a page
printed in landscape view (the page content should be rotated 90 degrees to the left on the underlying
page).
In order to have each of these paragraphs on different pages having different page orientation
characteristics, this document would be split into two sections. Looking at the WordprocessingML for
the example above:
This is sentence one.
ECMA-376 Part 1
This is sentence two.
This syntax defines two sections using two distinct sectPr elements: the first has a page size of 12,240
twentieths of a point wide and 15,640 twentieths of a point tall; the second has a page size of 15,640
twentieths of a point wide and 12,240 twentieths of a point tall, and is oriented in landscape mode.
L.1.7.1 Section Properties
As shown above, the end of a section is defined as a set of properties applied to the last paragraph in
that section—converting that paragraph mark into a section break (i.e., a paragraph that closes a
section).
Those properties are contained in a sectPr element, which is located within the paragraph properties
(the pPr element) for the final paragraph in that section. Within the definition of section properties, the
properties to be applied to that section (including, but not limited to, page size and orientation, line
numbering settings, margins, and columns) are specified. The complete set of section properties is
located on the definition for the sectPr element.
The only exception to this rule is the final set of section properties in this document. These are stored as
the last child of the body element. This is done because the document’s last paragraph must specify
paragraph properties, and this syntax enforces that the final set of section properties are specified.
Going back to our example, the first section break is defined within the last paragraph for that section,
but the last section properties are stored after the final paragraph.
L.1.7.2 Section Breaks
As well as specifying the section's properties, the type of section break is specified using the type
element. WordprocessingML supports four distinct types of section breaks:
Next page section breaks (the default if type is not specified), which begin the new section on
the following page.
Odd page section breaks, which begin the new section on the next odd-numbered page.
Even page section breaks, which begin the new section on the next even-numbered page.
Annex L
Continuous section breaks, which begin the new section on the following paragraph. This means
that continuous section breaks might not specify certain page-level section properties, since
they must be inherited from the following section. These breaks, however, can specify other
section properties, such as line numbering and footnote/endnote settings.
L.1.8 Styles
After looking at the primary elements of block-level content in a WordprocessingML file, it is now
necessary to look at the information stored in the document that affects how this content is displayed.
The first such group of information is styles. Within a WordprocessingML file, styles are predefined sets
of paragraph and/or character properties which can be applied to text within the document. This allows
the formatting properties to be stored and managed independently from the content, allowing the look
of document content to be changed in a single location (e.g., the look of all first-level headings is
changed by changing the style with styleId Heading1 rather than looking for and changing each
paragraph in the document).
The Normal paragraph style in a word processing document can have any number of formatting
properties, e.g., font face = Times New Roman; font size = 12pt; paragraph justification = left). All
paragraphs that reference this paragraph style would automatically inherit these properties.
L.1.8.1 Styles Part
Style information in a WordprocessingML document is stored in the Styles part within the package,
which is stored via an implicit relationship from the Main Document or Glossary Document part of
relationship type http://purl.oclc.org/ooxml/officeDocument/relationships/styles and has a content
type of vnd-openxmlformats.officedocument.wordprocessingml-styles+xml.
The styles part stores two types of style information for the document:
Style definitions
Latent style information
L.1.8.2 Style Definitions
Each style defined within a WordprocessingML document requires a style definition. The style definition
contains all of the information needed by a consumer to store and display that style within a
WordprocessingML document, and is defined using the style element. The style definition for any style
in WordprocessingML can be divided into three segments (Note: the complete definition of style
properties can be found on the reference for the style element):
Common style properties
Style ‘types’
Type specific properties
ECMA-376 Part 1
Common style properties refer to the set of properties which can be used regardless of the type of style;
for example, the style name, additional aliases for the style, a style ID (used by the document content to
refer to the style), if style is hidden, if style is locked, etc.
Consider a style called Heading 1 in a document as follows:
…
Above the formatting information specific to this style type are a set of common style properties which
define information shared by all style types.
Style types refer to the property on a style that defines the type of style created with this style
definition. WordprocessingML supports six types of style definitions:
Paragraph styles
Character styles
Linked styles (paragraph + character)
Table styles
Numbering styles
Default paragraph + character properties
Referring to the Heading 1 example above, the type attribute has a value of paragraph, which
indicates that the following style definition is a paragraph style.
L.1.8.3 Paragraph Styles
The first type of style definition, paragraph styles are styles that apply to the contents of an entire
paragraph as well as the paragraph mark. This definition implies that the style can define both character
properties (properties that apply to text within the document) as well as paragraph properties
(properties which apply to the positioning and appearance of the paragraph). Paragraph styles cannot
be referenced by runs within a document, they must be referenced by the pStyle element within a
paragraph’s paragraph properties (pPr) element.
A paragraph style has three defining type-specific characteristics:
The type attribute on the style has a value of paragraph, which indicates that the following
style definition is a paragraph style.
Annex L
The next element defines an editing behavior which supplies the paragraph style to be
automatically applied to the next paragraph when ENTER is pressed at the end of a paragraph of
this style.
The style specifies both paragraph-level and character-level properties using the pPr and rPr
elements, respectively. In this case, the run properties are the set of properties applied to each
run in the paragraph.
The paragraph style is then applied to paragraphs by referencing the styleId attribute value for this style
in the paragraph properties’ pStyle element.
Consider a paragraph style titled "Test Paragraph Style" which defines: paragraph spacing = double,
paragraph indent = 1” (first line only); font = Algerian, font color = red, font size = 20 points. The
resulting style definition would be:
Notice that the character properties for the style are under the rPr element, and the paragraph
properties are under the pPr element.
The document content for a paragraph of this style would be:
Here is some fancy Text
The pStyle element links the paragraph with the style definition.
ECMA-376 Part 1
L.1.8.4 Character Styles
The next type of style definition, character styles are styles which apply to the contents of one or more
runs of text within a document’s contents. This definition implies that the style can only define character
properties (properties which apply to text within a paragraph) because it cannot be applied to
paragraphs. Character styles can only be referenced by runs within a document, and they must be
referenced by the rStyle element within a run’s run properties element.
A character style has two defining type-specific characteristics:
The type attribute on the style has a value of character, which indicates that the following
style definition is a character style.
The style specifies only character-level properties using the rPr element. In this case, the run
properties are the set of properties applied to each run which is of this style.
The character style is then applied to runs by referencing the styleId attribute value for this style in the
run properties’ rStyle element.
Consider a character style titled "Test Character Style" which defines; font = Courier New, font color =
yellow; underline. The resulting style definition would be:
Notice that the character properties applied using this style are under the rPr element. The document
content for a paragraph with a run of this style would be:
The following text is in the
character style
Annex L
.
The rStyle element in the second run links that run with the style definition, inheriting the formatting
properties for that run.
L.1.8.5 Linked Styles
The next type of style definition, linked styles are actually a paired combination of styles which can be
applied to the contents of one or more runs of text within a document’s contents or the entire contents
of one or more paragraphs in a WordprocessingML document. This definition implies that the style can
define both a set of character properties (properties which apply to text within a paragraph) as well as a
set of paragraph properties (properties which apply to the positioning and appearance of the paragraph)
because it must be possible to apply the style to paragraphs as well as characters.
In order to accomplish these dual uses, a linked style is actually a pairing of a paragraph style and a
character style in the WordprocessingML document. Each style exists uniquely within the styles part, but
is linked by the link element, which specifies that these styles are each half of a linked style definition
and should be treated as one style at runtime.
A typical example of the use of a linked style is a quote style - if the style is applied to a paragraph, the
quoted text should be indented additionally to create a block quote effect, but if the style is applied to
text in a paragraph, only the character level effects should be applied.
Consider the following two styles which comprise a linked style pairing that defines the following: font is
Arial, font color is green; paragraph spacing is double, and indent is 1 inch left. The resulting style
definitions would be:
ECMA-376 Part 1
The link element in the paragraph style specifies TestLinkedStyleChar, the styleId of the paired
character style, and the link element in the character style specifies TestLinkedStyle, the styleId of
the paired paragraph style, creating a linked style combination.
Paragraph-level instances of linked styles can only be referenced by paragraphs within a document, and
they must be referenced by the pStyle element within the paragraph’s paragraph properties element
(pPr), which must reference the paragraph version of the linked style. Character-level instances of
linked styles can only be referenced by a run's run properties element (rPr) within a document, and they
must be referenced by the rStyle element within the run properties element which must reference the
character version of the linked style.
In the example above, the linked style definition is composed of the paragraph style, which specifies
both the run and paragraph properties, and the character style, which specifies only the run properties.
The document content for a paragraph with this linked style would be:
A para version of Test Linked Style.
The pStyle element in the paragraph’s properties links the paragraph with the paragraph version of the
linked style definition.
The document content for a paragraph with a run of this linked style would be:
Next run is character version of
Annex L
Test Linked Style
.
The rStyle element in the second run’s properties links the run with the character version of the linked
style definition.
L.1.8.6 Numbering Styles
Numbering styles are style definitions which specify common style properties for a multi-level
numbering format within a document. This means that a numbering style defines only a single
paragraph property: a reference to a numbering definition stored in the document’s numbering part,
using the numPr element.
Unlike paragraph and character styles, numbering styles are never directly referenced by content in the
document – instead, an abstract numbering definition (covered in the numbering topic of this section)
specifies that it is actually the underlying numbering information for a numbering style.
Consider a numbering style “Test Numbering Style”:
The only information specified in the numbering style definition is a reference to the numbering
definition for the numbering information which is defined by this numbering style.
L.1.8.7 Table Styles
The last conventional type of style definition, table styles are styles which apply to the contents of zero
or more tables within a document. This definition implies that the style can only define table properties
(properties which apply to the table and its constituent rows and cells), however a table style can also
ECMA-376 Part 1
define paragraph properties (properties which apply to the positioning and appearance of paragraphs)
as well as character properties (properties which apply to runs) for all of the paragraphs and runs within
the specified table in the document. Table styles can only be referenced by tables within a document,
and they must be referenced by the tblStyle element within a table’s table properties (tblPr) element.
Like the style definitions discussed above, table styles specify all of the properties that can be applied to
a table, as well as paragraph and character properties for the table’s contents. However, unlike other
style definitions, table styles allow for the definition of conditional formats for different regions of the
table.
These table conditional formats are applied to different regions of the table as follows:
All rows in the table can also have conditional formatting on an alternating row/column basis as well as
follows:
Annex L
When specified, these conditional formats are applied in the following order (therefore subsequent
formats override properties on previous formats):
Whole table
Banded columns, even column banding
Banded rows, even row banding
First row, last row
First column, last column
Top left, top right, bottom left, bottom right
Consider a table style “Test Table Style” defined as follows: all cells with 1pt table borders on all sides,
0.1” cell margins on left and right of cells, and 0” cell margins on top and bottom of cells, as well as
header row specific formatting of: red shading, bold text as follows:
ECMA-376 Part 1
The tblPr element holds the formatting which is applied to the entire table, and the tblStylePr element
with a type attribute value of firstRow holds the formatting for the first table row, specifically the
bold run property and red cell shading.
An individual instance of a table defines an association with a table style using the tblStyle element in
the table’s properties (tblPr), as discussed above. However, individual tables can choose whether to
apply the following aspects of the table’s conditional formats individually:
First row
Last row
First column
Last column
Row banding
Column banding
The use or omission conditional formats are specified using the tblLook element, which contains a
number of attributes that indicate which properties are applied and omitted.
Annex L
Consider two tables using the table style "Style2"; one which specifies that it should only use the header
row and footer row conditional formatting properties from the table style, and the other which specifies
that it should use the header row, footer row, and banded row conditional formatting:
…
…
…
The tables each specify the appropriate set of conditional formats using the tblLook element, as seen by
the identical table styles in the tblStyle element, and different tblLook values.
L.1.8.8 Default Document Paragraph and Character Properties
The final type of style in a WordprocessingML document is the default paragraph and character
properties for the document. Although this is not a style in the strict sense of the word (because this
property set cannot directly be applied to text) it defines the basic set of formatting properties which
are inherited by paragraphs and runs in the document.
The following section, entitled Style Inheritance, explains exactly how the default document paragraph
and character properties influence the appearance of all content in the document.
L.1.8.9 Style Inheritance
In order to compile the complete set of paragraph and character properties specified by any given style
(as appropriate), a consumer must follow the rule of style inheritance to determine each property in
that set.
Style inheritance states that styles of any given type can inherit from other styles of that type, and
therefore a consumer must ‘build up’ the style information by following the inheritance tree. This
inheritance is defined via the basedOn element, which specifies the styleId of the parent style.
ECMA-376 Part 1
The “Tristan Test” paragraph style can inherit properties from the “Heading 1” paragraph style, which
itself can inherit properties from the “Normal” paragraph style.
To build up the resulting style, a consumer must trace the hierarchy (following each basedOn value)
back to a style which has no basedOn element (is not based on another style). The resulting style is then
constructed by following each level in the tree, applying the specified paragraph and/or character
properties as appropriate. When properties conflict, they are overridden by each subsequent level (this
includes turning OFF a property set at an earlier level). Properties which are not specified simply do not
change those specified at earlier levels.
Consider a character style “Green” which specifies only that the text color is green, but inherits from
another character style “Base” which defines a font face of Arial, as well as bold:
…
The definition of the Green character style has a basedOn element which specifies the Base style. This
means that any use of the Green style is defined as bold, green, Arial text.
Conversely, a producer should not output any property on a style which has already been set by a
previous level of the style hierarchy, as well as those which match the document defaults. This means
that if the document defaults or any previous level in a style’s hierarchy specify a property which is
unchanged at this level, that property should not be part of the style definition in the resulting
WordprocessingML. Adding a property at multiple levels in the style hierarchy is not an error, but
unnecessarily duplicative as the setting is already applied to the text, resulting in an unnecessary
increase to file size.
If the document default font is Bauhaus 93 and the Heading 1 style also specifies the Bauhaus 93
font, then a producer should not output any rFonts element for the Heading 1 style definition,
because that formatting is inherited from the document defaults.
Annex L
L.1.8.10 Style Application
With the various flavors of styles available, multiple style types can be applied to the same content
within a file, which means that properties must be applied in a specific deterministic order. As with
inheritance, the resulting formatting properties set by one type can be unchanged, removed, or altered
by following types.
The following table illustrates the order of application of these defaults, and which properties are
impacted by each:
This process can be described as follows: First, the document defaults are applied to all runs and
paragraphs in the document. Next, the table style properties are applied to each table in the document,
following the conditional formatting inclusions and exclusions specified per table. Next, numbered item
and paragraph properties are applied to each paragraph formatted with a numbering style. Next,
paragraph and run properties are applied to each paragraph as defined by the paragraph style. Next, run
properties are applied to each run with a specific character style applied. Finally, we apply direct
formatting (paragraph or run properties not from styles).
L.1.8.11 Latent Styles
The final piece of information stored in the styles part in the document, aside from style definition
information, is latent style information.
ECMA-376 Part 1
Latent styles are all styles contained in a document’s template which have not yet been instantiated
(used) in the current instance of the document.
In WordprocessingML, there are often properties which must be set on all styles in a document
template regardless of whether they are being used: for example, whether or not the style can be
applied in the current document (locked state), UI sorting priority, whether the style should be shown in
the user interface, etc. In order for the document to function correctly, it is essential that this
information is stored within the document, so that a consumer can determine the necessary style
information from the document alone (without access to the template). However, it would be grossly
inefficient for the document to store all style information for all styles simply to store this information,
so latent styles are used to store just the necessary style properties without caching all style information
in the document.
In order to do this efficiently, the document declares a latentStyles element in the styles part which
defines the default properties applied to all latent styles in the document. All styles whose properties do
not match the default for the set of style properties which must be defined for all styles are explicitly
defined using the lsdException element.
Consider the following latent style information stored in a document’s styles part:
The attributes on the latentStyles element define the properties applied to all latent styles for this
document. All styles whose properties do not match the default latent styles properties are explicitly
defined using the values on the lsdException elements.
Annex L
L.1.9 Fonts
L.1.9.1 Font References
Within a WordprocessingML document, font face information can be referenced by any set of run
properties, both as part of a style definition or direct formatting on one or more runs in the document's
contents. This reference is established by referencing the primary name of the font face that is used in
the rFonts element of the run properties, linking that run with the desired font face.
For example, consider a run of text that has been directly formatted to use the Arial Black font face.
This setting would be specified as follows on the run's properties:
This run of text uses the Arial Black font face.
The rFonts element specifies that the run should be formatted using the Arial Black font face.
Applications can then look up and use the font with primary name of Arial Black when formatting
this run.
L.1.9.2 Font Reference Types
In the example above, two attributes were present, both referring to the font face with primary name
Arial Black. This simple case illustrates the ability for a WordprocessingML document to store up to
four fonts which can be used on the contents of a run, as follows:
ASCII font
High ANSI font
East Asian font
Complex Script font
Each of these font faces is used to format the characters in the run that fall under their purview:
The ASCII font formats all characters in the ASCII range (Unicode character values U+0000–U+007F). This
font is specified using the ascii attribute on the rFonts element.
The East Asian font formats all characters that belong to Unicode sub ranges for East Asian languages.
This font is specified using the eastAsia attribute on the rFonts element.
The complex script font formats all characters that belong to Unicode sub ranges for complex script
languages. This font is specified using the cs attribute on the rFonts element.
ECMA-376 Part 1
The high ANSI font formats all characters that belong to Unicode sub ranges other than those explicitly
included by one of the groups above. This font is specified using the hAnsi attribute on the rFonts
element.
For example, consider a run of text defined as follows:
…
The rFonts element specifies that the contents of this run are formatted as follows:
Complex script characters used the Arial font
East Asian characters used the SimSun font
All other characters used the Arial Black font
L.1.9.3 Ambiguous Characters
When classifying characters into one of the four slots defined above, it is likely that the classification of
some characters is ambiguous (the resulting classification would be equally applicable for one or more
font slots).
To handle this, the font face information can also include a hint, which specifies how ambiguous
mappings are resolved into a font slot. This information is stored on the hint attribute on the rFonts
element, and specifies the bucket into which these ambiguous characters fall.
For example, if the hint attribute has a value of eastAsia, then all ambiguous characters must be
formatted using the East Asian font face.
L.1.9.4 Font Table
Within a document, the font table contains information about the fonts used in the document to allow:
Applications to perform substitution with the most appropriate possible font when the desired
font face is not available on the system. Since some fonts are commercially distributed, it is
possible for a document to be formatted with one or more fonts that are not available
depending on the machine opening the current system. This information allows the application
that cannot locate the desired font to perform the most appropriate possible match.
Embedding of fonts in the document to prevent the need for font substitution
The font table part is stored via an implicit relationship from either the main document part or the
glossary document part, and has a relationship type of
Annex L
http://purl.oclc.org/ooxml/officeDocument/relationships/fontTable, and a content type of vnd-
openxmlformats.officedocument.wordprocessingml-fontTable+xml.
L.1.9.5 Font Substitution Data
The first classification of data stored in the font table are an optional set of font metrics which are
queried from the font and stored in the document such that future applications can utilize them when
the desired font is not available. If a particular font face cannot be located on the current system, then
this data is used to substitute a font that most appropriately matches its characteristics.
For example, consider the font substitution data stored for the Arial Black font:
This data is linked to the font face with a name of Arial Black via the name attribute, and stores the
following information about the font (see the reference material on fonts for more details):
The font's Panose-1 number
The character set of the font
The font's family
The font's pitch
The code pages and Unicode sub ranges supported by the font
L.1.9.6 Font Embedding
As well as providing information about the font's metrics, applications can be directed to embed the
contents of a font (partially or as a whole) into a document, a process known as font embedding. Font
embedding literally embeds an obfuscated version of the font into the file so that it can be retrieved and
used to view the contents of this document - but the obfuscation ensures that the font cannot be
extracted and used for any other document (as it might have a commercial license).
Within the font table, when a font is embedded there are explicit relationships to each font form
needed:
Regular
Bold
Italic
Bold + Italic
ECMA-376 Part 1
Each form is obfuscated using the mechanism described in the reference material on this subject.
L.1.9.7 Theme Fonts
As well as storing standard font face information, run properties can store an abstraction for font face
information known as theme fonts. Theme fonts are values that specify that the font face information
for a run is not stored in the attribute value using the appropriate font face name, but is rather a
reference into the document's theme part, allowing font face information to be stored and managed
centrally as part of the theme data. It is appropriate to think of theme fonts as a "style for fonts" in the
same way in which a style is a reference to the formatting that is stored centrally in another part.
Theme fonts are specified using the theme attribute variants in the rFonts element, rather than storing
the actual font face name.
For example, consider a run of text defined as follows:
…
The rFonts element's attribute values of asciiTheme and hAnsiTheme both store a reference to a
theme font stored in the document's theme part (i.e., there is no font with the primary name
minorHAnsi).
Once this information has been established, it is combined with the theme language data stored in the
document's settings to resolve the appropriate theme fonts from the theme part. The syntax and format
of the theme part are stored in the DrawingML syntax and discussed in that section.
L.1.10 Numbering
Numbering in WordprocessingML refers to symbols—Arabic numerals, Roman numerals, symbol
characters ("bullets"), text strings, etc.—that are used to label individual paragraphs of text.
The following two paragraphs each contain numbering as defined by WordprocessingML: the first uses
an Arabic numeral, the second a symbol character:
1. This is a paragraph with numbering information.
This is also a paragraph with numbering information.
L.1.10.1 Numbering Part
Numbering information in a WordprocessingML document is stored in the Numbering part within the
package, which is stored via an implicit relationship from the Main Document part or Glossary
Document part of relationship type
Annex L
http://purl.oclc.org/ooxml/officeDocument/relationships/numbering and has a content type of vnd-
openxmlformats.officedocument.wordprocessingml-numbering+xml.
L.1.10.2 Numbering Definitions
The specification of a specific set of numbering information is called a numbering definition. Numbering
definitions are stored in two components:
Abstract numbering definitions
Numbering definition instances
As shown below, their relationship is (essentially) that of an abstract and an inherited class.
L.1.10.3 Abstract Numbering Definitions
An abstract numbering definition is the basis for all numbering information in a WordprocessingML
document, as it defines the appearance and behavior of a specific set of numbered paragraphs in a
document, and is defined using the abstractNum element. Although abstract numbering definitions
contain all of the numbering information for one type of numbering, they cannot be directly referenced
by content (hence their abstract designation), they must be inherited by a numbering definition
instance, which itself can be referenced by content. A specific abstract numbering definition in
WordprocessingML can be divided into two parts:
Common numbering properties
Numbering levels
The complete definition of all abstract numbering properties can be found in the reference for the
abstractNum element.
Common numbering properties refer to the properties that can be specified by all abstract numbering
definitions regardless of their contents. Examples of common numbering properties include: a
numbering ID (which uniquely identifies a numbering definition), the numbering definition type (single
level, multi-level, multi-level hybrid), the numbering name, and optional numbering style references, as
discussed in detail later in this subclause.
Consider the following example of an abstract numbering definition in a WordprocessingML document:
…
…
ECMA-376 Part 1
…
…
…
This numbering definition specifies two common properties: a numbering ID (using the nsid element) of
1DE04504, and a list type (using the multiLevelType element) of hybridMultilevel, which specifies
that this abstract numbering definition is more than one level and contains multiple numbering formats.
The other part of an abstract numbering definition is the specification of one or more numbering levels,
each of which defines a unique set of formatting properties for one level in this numbering definition.
Consider three numbered paragraphs that reference the same numbering definition, but each, in turn,
reference a different level within that list:
Although the paragraphs each reference the same abstract numbering definition (which is discussed
later), each refers to a separate level within that abstract numbering definition, and therefore each has
a unique set of paragraph and numbering properties.
It is important to note that the concept of levels in an abstract numbering definition refers to the levels
as defined in the file format, and in no way the logical indentation of numbered paragraphs within a
WordprocessingML document.
Consider another set of numbered paragraphs in WordprocessingML, where each subsequent paragraph
is a different level but references the same abstract numbering definition:
In this example, the properties of each level of the numbering definition is such that the paragraphs for
each level are indented arbitrarily. However, this is still a completely acceptable numbering definition,
and the paragraphs each represent subsequent levels of the same numbering definition.
Annex L
Within an abstract numbering level definition, each numbering level is represented by an lvl element
that defines a single level of numbering information. Numbering levels specify the following properties:
starting number value, a number format presentation code (e.g., 1 vs. the string literal One), an
associated paragraph style, which previous level should cause this numbering level to restart, the
numbering text, number justification, a paragraph properties indentation for this level, etc. The
complete definition of all numbering level properties can be found on the reference for the lvl element.
Consider the following numbering level definition in WordprocessingML:
This particular numbering level defines the following information:
This is level 1 (the second level) for this numbering definition
Start at number 4
Use number format 3 (which translates to 1, 2, 3, and so on)
When this level is used, apply the Heading1 style
Use the following level text for the number: BEFORE %2 AFTER %1 END
Left justify the number
Set a left indent of 288 twentieths of a point, and a first line indent of 1152 twentieths of a point
This information is used to display the number for paragraphs of level 1 the reference this numbering
definition.
Of particular significance is the lvlText element, which defines the content of the number text for each
numbering level. Its syntax allows any string literal to be placed in the number (e.g., the ARTICLE in
ARTICLE I, ARTICLE II, ARTICLE III, and so on), as well as the current value of the number for this or any
previous level in the list.
Referring to the numbering level definition above, the lvlText is defined as follows:
ECMA-376 Part 1
This level text specifies three literal strings (BEFORE, AFTER, END) mixed with the current numbering
value from level 1 and level 0 in the document. Therefore, assuming level 0 is just a simple number,
when inserted it would read:
BEFORE 1 AFTER 1 END
BEFORE 2 AFTER 1 END
BEFORE 3 AFTER 1 END
BEFORE 1 AFTER 2 END
BEFORE 2 AFTER 2 END
…
The %1 and %2 values correspond to the value for level 0 and 1 of this list, respectively.
L.1.10.4 Numbering Definition Instances
A numbering definition instance is a specific instantiation of numbering information that can be
referenced by zero or more paragraphs within the document. A numbering definition instance is defined
using the num element. A specific numbering definition instance in WordprocessingML can be divided
into two parts:
An abstract numbering reference
(Optional) level overrides
The definition of all numbering definition instance properties can be found on the reference for the num
element.
The required piece of information in a numbering definition instance, the instance must reference an
abstract numbering definition using the abstractNumId element. This element specifies the value of the
abstractNumId attribute for the inherited abstract numbering definition information.
Consider the WordprocessingML for a document with four numbering definition instances, two of which
reference the same underlying abstract numbering definition:
…
Annex L
As shown above, the first two numbering definition instances reference abstractNumId values of 0
and 1 respectively, and the last two both reference the abstract numbering definition with an
abstractNumId of 4.
The second (and optional) piece of information for a numbering definition instance is one or more
numbering level overrides using the lvlOverride element. This element specifies a set of optional
overrides applied to zero or more levels from the abstract numbering definition inherited by this
instance.
Consider a numbering definition instance that inherits its information from the abstract numbering
definition with abstractNumId of 4, but wishes to use a different set of properties for level 0 of the
numbering definition. The resulting WordprocessingML would look like:
This level overrides level 0 of the list with the specified set of numbering properties, replacing those in
the abtract numbering definition.
L.1.10.5 Applying Numbering to Paragraphs
Once numbering information is defined in the numbering part, this information must be associated with
paragraphs within the document in order to display numbering on one or more paragraphs of content.
To accomplish this, numbered paragraphs are identified by the numPr element within the paragraph's
properties element (the pPr element). The numbering properties within a paragraph are specified using
two specific elements that specify the numbering definition information to use:
A numbering definition instance reference
A numbering level reference
ECMA-376 Part 1
The numbering definition instance reference is specified using the numId element. This element
contains a reference to the numId attribute in a specific numbering definition instance within the
numbering part, which links this paragraph to that numbering definition instance.
The numbering level reference is specified using the ilvl element. This element contains a reference to
the ilvl attribute in the specified numbering definition instance's level information, which specifies the
numbering level within the referenced numbering definition instance to be used by this numbered
paragraph.
Consider the following numbered paragraphs in a WordprocessingML document:
These four numbered paragraphs, all referencing the same numbering definition, produce the following
WordprocessingML:
Level one item one
Annex L
Level two item one
Level one item two
Level two item one
In these numbered paragraphs, level 0 and 1 of the numbering definition are referenced through the ilvl
element with a val attribute of 0 or 1, respectively, however, the numId element always references the
numbering definition instance with a val of 5.
The numbering at any particular numbering level is restarted when a paragraph in the current document
from the same numbering definition uses the level specified in the lvlRestart element for this
numbering level.
Consider a set of numbered paragraphs in a WordprocessingML document where:
ECMA-376 Part 1
Level 1 is set to restart after each level 0 (lvlRestart of 1)
Level 2 is set to never restart (lvlRestart of 0)
As the example shows, the numbering at level 1 (a, b, c, and so on) restarts after each level 0 is used, but
level 2 (i, ii, iii, and so on) never restarts.
L.1.10.6 The Complete Story
To summarize the use of numbering information in a document, the paragraph properties specify a
numPr element, which references a numbering definition instance via the numId element. The
numbering definition instance specifies an inherited abstract numbering definition via the
abstractNumId element. The paragraph then also specifies the list level from the numbering definition
instance using the ilvl element.
Consider the following WordprocessingML for a numbered paragraph:
Numbered paragraph
Based on the numId of 5, the paragraph uses the numbering definition instance with a numId of 5:
Annex L
…
Based on the abstractNumId of 4, this instance inherits the abstract numbering definition with an
abstractNumId of 4:
…
Since the numbering definition instance does not specify an override for ilvl 0, the definition for the
corresponding level from the abstract numbering definition is applied to the text.
L.1.10.7 Numbering Styles
As stated earlier in the styles subclause (§L.1.8), numbering styles are style definitions which specify
common formatting properties for a multi-level numbering format within a document. This means that a
numbering style definition in the styles part defines only a single property: a reference to a numbering
definition instance stored in the document’s numbering part, using the numId element within the
numPr element. That numbering definition instance specifies an abstract numbering style, which
contains the numbering level information for the numbering style. It also specifies that it is the basis for
the numbering style by back-referencing the numbering style's styleId attribute via the styleLink
element.
Unlike paragraph and character styles, numbering styles are never directly referenced by content in the
document—instead, an abstract numbering definition specifies that it contains the underlying
ECMA-376 Part 1
numbering information for a numbering style, and one or more numbering definition instances
reference that abstract numbering definition.
L.1.10.8 Referencing Numbering Styles
To use a numbering style in a document, the paragraph properties for one or more paragraphs again
specify a numPr element, which references a numbering definition instance via the numId element. The
numbering definition instance itself again specifies an inherited abstract numbering definition via the
abstractNumId element.
At this stage, the abstract numbering definition specifies that it is based on a numbering style via either
of the following:
The abstract numbering style contains no level data, and simply specifies a reference to the
numbering style's styleId attribute via the numStyleLink element.
The abstract numbering style contains the numbering level information for the numbering style,
and specifies that it is the basis for the numbering style by referencing the numbering style's
styleId attribute via the styleLink element.
Although the result of each method is identical, the following two examples illustrate each of the
syntaxes:
Consider the first numbering style syntax, in which the numbering on a paragraph is based on an
abstract numbering definition which simply references the numbering style via numStyleLink. The
contents of the paragraph would consist of the following:
This paragraph references a numbering style via
numStyleLink.
The numId element references a numbering definition instance with a value of 6, located in the
numbering part:
Annex L
Based on the abstractNumId of 0, this instance inherits the abstract numbering definition with an
abstractNumId of 0:
This abstract numbering definition contains no numbering information - it simply notes that it inherits
the numbering information from the numbering style TestNumberingStyle by referencing the
styleId attribute on that style:
The style references a numbering definition instance, again via the numId element:
Based on the abstractNumId of 2, this instance inherits the abstract numbering definition with an
abstractNumId of 2:
ECMA-376 Part 1
…
This abstract numbering definition defines the properties for each level of the numbering format
(levels 1 through 9 omitted for brevity). Since neither of the numbering definition instances specified
overrides for level 0, the properties from abstract numbering format 2 are applied to level 0 in the
resulting numbering definition instance and are applied to the text via the ilvl element.
Consider the second numbering style syntax, in which the numbering on a paragraph is based on an
abstract numbering definition which defines the numbering information and references the numbering
style via styleLink. The contents of the paragraph would consist of the following:
This paragraph references a numbering style via styleLink.
The numId element references a numbering definition instance with a value of 4, located in the
numbering part:
Annex L
Based on the abstractNumId of 2, this instance inherits the abstract numbering definition with an
abstractNumId of 2:
…
This abstract numbering definition defines the properties for each level of the numbering format
(levels 1 through 9 omitted for brevity) and specifies that it is the underlying numbering information for
a numbering format by referencing the styleId of that numbering style via the styleLink element. Since
the numbering definition instances specified no override for level 0, the properties from abstract
numbering format 2 are applied to level 0 in the resulting numbering definition instance and are applied
to the text via the ilvl element.
L.1.11 Headers and Footers
Headers and footers refer to text, graphics, or data (such as page number, date, document title, and so
on) that can appear at the top or bottom of each page in a WordprocessingML document.
A header appears in the top margin (above the main document content on the page), while a footer
appears in the bottom margin of a document page (below the main document content on the page); for
example:
ECMA-376 Part 1
Since WordprocessingML is a flow-based format, headers and footers are applied by specifying the
headers and footers for all pages in a particular section of a document.
L.1.11.1 Header Part
Header information in a WordprocessingML document is stored in a header part within the package,
which is stored via an implicit relationship from the Main Document part or the Glossary Document part
of relationship type http://purl.oclc.org/ooxml/officeDocument/relationships/header and has a content
type of vnd-openxmlformats.officedocument.wordprocessingml-header+xml.
L.1.11.2 Footer Part
Footer information in a WordprocessingML document is stored in a footer part within the package,
which is stored via an implicit relationship from the Main Document part or the Glossary Document part
of relationship type http://purl.oclc.org/ooxml/officeDocument/relationships/footer and has a content
type of vnd-openxmlformats.officedocument.wordprocessingml-footer+xml.
L.1.11.3 Headers and Footers
As described above, header and footer information is stored in one or more header or footer parts
within the package.
The hdr element defines a single header for the document, while the ftr element defines a single footer
for the document. Headers and footers are just another document story in WordprocessingML. Within
the root element of the header or footer, the content of the element is similar to the content of the
body element, and contains what is referred to as block-level markup —markup that can exist as a
sibling element to paragraphs in a WordprocessingML document.
Within each section of a document there can be up to three different types of headers and footers:
First page header/footer
Odd page header/footer
Even page header/footer
Annex L
First page headers and footers specify a unique header or footer that must appear on the first page of a
section. Odd page headers and footers specify a unique header and footer that must appear on all odd
numbered pages for a given section. Even page headers and footers specify a unique header and footer
that must appear on all even numbered pages in a given section.
Different headers or footers can be useful for bounded documents like books, as shown in the figure
below.
Consider the following simple one-page document with one header:
This document defines one header with the text Header. The header's content is stored in a unique
Header part. The resulting header is represented by the following WordprocessingML:
Header
ECMA-376 Part 1
Since headers are containers of block level contents, all block level contents can be used within them. In
this particular example, the content is a single paragraph.
Consider a more complex three-page document with different first, odd, and even page headers
defined:
This document defines three headers stored in three different header parts. The resulting headers are
represented by the following WordprocessingML:
First page header part:
First
Even page header part:
Even
Odd page header part:
Annex L
Odd
L.1.11.4 Multiple Sections
Documents are capable of having multiple sections, where each section can define up to three headers
and footers. By default, sections other than the first section inherit the previous header and footer
references, unless that section specifies header and footer references.
Consider a two-page, two-section document with only the first section header defined. This document
defines one header that is referenced in the first section. The document is represented by the following
WordprocessingML:
…
…
…
…
ECMA-376 Part 1
…
The second section does not explicitly reference a header. Instead, the second section inherits the
header from the previous section.
L.1.11.5 Empty Header or Footer
Not specifying a header and footer reference in a section, other than the first section, causes the
document to inherit the previous section's header and footer references. In order to declare an empty
header or footer, a header or footer reference must be made to a null header or footer relationship, as
follows:
The null attribute value specifies that the header or footer must not be inherited from the previous
section, and a blank header or footer must explicitly be used.
L.1.12 Footnotes and Endnotes
Footnotes and endnotes are separate text stories used in documents and books to show the source of
borrowed material or to enter explanatory or supplementary information that does not interrupt the
normal reading flow of the document.
Footnotes are typically located at the bottom of a page or beneath text being referenced, and endnotes
are typically placed at the end of a document or at the end of a section. If document has been divided
up into one or more sections, each section of a document can contain endnotes.
Both footnotes and endnotes consist of two parts:
A note reference mark in the body text to indicate that additional information is in a footnote or
endnote, with a numbering system used for each to tell readers whether to look for the note at
the end of the page or the end of the document or section.
The actual footnote or endnote story content.
Here's an example of a footnote applied to text in a document:
Annex L
The note reference mark follows the noted text and specifies that there is associated footnote
information; the footnote itself is at the bottom of the current page.
Consider the following example of an endnote applied to text in a document:
ECMA-376 Part 1
The note reference mark follows the noted text and specifies that there is associated endnote
information; the endnote itself is at the end of the current section.
L.1.12.1 Footnote Part
Footnote information in a WordprocessingML document is stored in the footnotes part within the
package, which is stored via an implicit relationship from the Main Document part or Glossary
Document part of relationship type http://purl.oclc.org/ooxml/officeDocument/relationships/footnotes
and has a content type of vnd-openxmlformats.officedocument.wordprocessingml-
footnotes+xml.
L.1.12.2 Endnote Part
Endnote information in a WordprocessingML document is stored in the Endnotes part within the
package, which is stored via an implicit relationship from the Main Document part or Glossary
Document part of relationship type http://purl.oclc.org/ooxml/officeDocument/relationships/endnotes
and has a content type of vnd-openxmlformats.officedocument.wordprocessingml-
endnotes+xml.
L.1.12.3 Footnotes and Endnotes
As described above, footnote and endnote information is stored in the corresponding footnotes and
endnotes part within the package. The footnotes element below specifies three or more footnotes, each
identified by the footnote element, for the document. The endnotes element specifies three or more
endnotes, each identified by the endnote element, for the document. Each footnote or endnote
element is associated with a unique ID, specified by the attribute id.
Consider three different types of footnotes, each identified by a footnote element, defined in the
Footnotes part. The use of each type of footnote is defined in the next subclause:
…
…
…
Similarly consider three different types of endnotes, each identified by an endnote element, defined in
the Endnotes part. The use of each type of endnote is defined in the next subclause:
Annex L
…
…
…
Footnotes and endnotes are just another kind of paragraph in WordprocessingML. Within the footnote
or endnote element, the footnote or endnote can contain any valid block-level content, as defined by
the WordprocessingML schema.
L.1.12.4 Footnote and Endnote Types
There are four different types of footnotes and endnotes:
Normal – contain the text of any footnote (or endnote) in the document.
Separator – define the separator used to separate the footnote (or endnote) from the document
text.
Continuation separator – define the separator used to separate the footnote (or endnote) from
the document text when the footnote or endnote is a continuation from the previous page.
Continuation notice – define the notice text to let readers know that the footnote (or endnote)
has continued on the next page.
The attribute type specifies the type of footnote or endnote. Normal footnotes or endnotes are
specified by a type attribute value of normal or by omitting the type attribute. In conjunction, a
footnote reference mark, specified by footnoteRef element, or endnote reference mark, specified by
endnoteRef element, must be present within the footnote or endnote definition.
ECMA-376 Part 1
Consider the following page in a document, where some text is referenced by a footnote at the end of a
page:
The footnote text at the bottom of the page is a normal footnote type, represented by the following
WordprocessingML:
Cool reference
Not specifying any type attribute in the footnote element defaults to being a normal type of footnote.
In this example, the footnote has a unique ID of 2. The text of the footnote is contained in the text run.
Like any paragraph, footnotes can be associated with a particular style, and, in this example, the
paragraph uses the FootnoteText paragraph style. Similarly, like any run, footnotes can be associated
with a particular style, and, in this example, the run uses the FootnoteReference run style.
Annex L
Separator footnotes or endnotes are specified by separator. These types of footnotes or endnotes
define the look of the separator used to separate document text from footnotes or endnotes. In
conjunction to separator type, a footnote or endnote separator reference mark, specified by a
separator element must be present within the footnote or endnote definition.
Consider the following page in a document, where some text is referenced by a footnote at the end of a
page:
The line separating the document text from the footnote is represented by the following
WordprocessingML:
In this example, the footnote has a unique ID of 0. The vertical spacing after the line separator is
0 twentieths of a point. The vertical spacing between the line separator and text is 240 twentieths of a
point.
Continuation separator footnotes or endnotes are specified by continuationSeparator. These types of
footnotes or endnotes define the look of the separator used to separate document text from footnotes
or endnotes when the footnote or endnote continues the next page. In conjunction to a
ECMA-376 Part 1
continuationSeparator type, a footnote or endnote continuation separator reference mark, specified
by continuationSeparator element must be present within the footnote or endnote definition.
Consider the following two pages in a document, where some text is referenced by a footnote that
extends to the next page:
The line separating the document text from the footnote that is continued on the next page (circled in
red in the image above) is the continuation separator footnote, and is represented by the following
WordprocessingML:
In this example, the footnote has a unique ID of 1. The vertical spacing after the line separator is
0 twentieths of a point. The vertical spacing between the line separator and text is 240 twentieths of a
point.
Continuation notice footnotes or endnotes are specified by continuationNotice. These types of
footnotes or endnotes specify the text to let readers know that the footnote or endnote is continued on
the next page.
Annex L
Consider the following two pages in a document, where some text is referenced by a footnote that
extends to the next page. A continuation notice is given to readers to indicate that the footnote extends
to the next page:
The continuation notice text is at the bottom of the footnote indicating that the footnote is continued to
the next page (which reads continued on next page above) and is represented by the following
WordprocessingML:
(continued on next page)
In this example, the footnote has a unique ID of 3. The text that shows up after the footnote text is
(continued on next page).
L.1.12.5 Footnote and Endnote Reference
Once footnote or endnote information is defined in the footnotes or endnotes part, this information
must be associated with document text within the document in order to display the footnotes or
endnotes. Each footnote or endnote is identified by a unique ID that references footnote or endnote
definitions specified in the footnotes or endnotes part. Footnote or endnote references are identified by
the footnoteReference or endnoteReference element within the text run's element (the r element).
The footnoteReference or endnoteReference element points to the footnote or endnote ID defined in
the footnotes or endnotes part.
ECMA-376 Part 1
Consider the following one-page document, where some text is referenced by a footnote at the end of
the document page:
The footnote references text and is represented by the following WordprocessingML:
Some referenced text
The footnote references the footnote in the footnotes part with ID equals to 2. Like any run, footnotes
can be associated with a particular style, and, in this example, the run uses the FootnoteReference run
style. The style of the footnote defines the look and numbering of the footnote.
L.1.13 Glossary Document
The introduction to a WordprocessingML document formally introduced the concept of stories,
individual ranges of a word-processing document containing block-level content like paragraphs and
tables. Some examples of stories in a WordprocessingML document include the following: the main
document, headers, footers, comments, footnotes, and endnotes.
At that time, a story was defined by two characteristics:
Annex L
It is a unique region containing block-level content
All document stories shared the same set of properties (e.g., style definitions, numbering
definitions, and settings)
The glossary document, although it follows the first rule, actually defies the second.
Within a WordprocessingML file, the glossary document is a supplemental storage location for
additional document content which must travel with the document, but which must not be displayed for
printed as part of the main document until it is explicitly added to that document by deliberate action.
The glossary document must also be afforded a separate instance of all of the relationships that are
provided on the main document part - this means that the glossary document must have its own style
definitions, numbering definitions, comments, headers, footers, etc. within the WordprocessingML
document.
Consider a document that must include ten optional clauses that can be inserted through a user
interface. It is clearly not desirable to have these ten clauses appear in the main document story's
contents before they are explicitly inserted, therefore each of them can be stored in the glossary
document and inserted via the user interface as needed.
Within the glossary document, each distinct region of document content is referred to as a glossary
document entry, and is defined via the docPart element. These document parts can contain any block-
level WordprocessingML element, and can also have a set of classifications and behaviors applied to
them via the glossary document entry's properties.
Consider the following definition for the contents of a glossary document part within a
WordprocessingML document:
…
Sample entry.
ECMA-376 Part 1
…
The glossaryDocument element defines the contents of the glossary document part. Within the
glossary document, each docPart element contains the definition for one glossary document entry: in
this case, there are two entries in the glossary document, the first of which contains a single paragraph
with a single run of text.
Each glossary document entry consists of two components:
The entry's properties, specified using the docPartPr element
The entry's contents, specified using the docPartBody element
The first specifies information about the entry (e.g., its classification) for when it is inserted, the latter
stores the block level content which constitutes the entry.
L.1.14 Annotations
L.1.14.1 Introduction
An annotation is one of various kinds of supplementary markup, which can be stored inside or around a
region of text within the document's contents. The kinds of supplementary information stored within a
document can include comments (§L.1.14.5), revisions (§L.1.14.7), spelling and/or grammatical errors
(§L.1.14.10), bookmark information (§L.1.14.8), and optional editing permissions (§L.1.14.9).
Within a document's contents, annotations are stored in one of three different forms:
Inline
Cross-Structure
Properties
These three forms are needed in order to maintain compatibility with both the legacy annotations
functionality of current word-processing applications and the requirements of an XML-based format
(i.e., well-formedness of the resulting XML markup). These three forms are referenced within the
individual annotation types described in subclauses §L.1.14.2 through §L.1.14.4.
L.1.14.2 Inline Annotations
An inline annotation is a form of annotation that does not require special handling in order to maintain
the XML well-formedness requirements of the resulting WordprocessingML output. In these cases, a
single XML element must encapsulate the entire contents of the document content which is being
annotated.
Annex L
Consider the following WordprocessingML markup for a paragraph that reads The quick brown fox
jumps over the jet lagged dog., where jet lagged replaced the previous text lazy when
the editing application was tracking revisions:
The quick brown fox jumps over the
lazy
jet lagged
dog.
The del and ins elements each fully encapsulate the extent of their respective annotations (a marked
deletion and insertion, respectively), as they are inline annotations.
L.1.14.3 Cross-Structure Annotations
A cross-structure annotation is a form of annotation that can span portions of WordprocessingML
markup. (Cross-structure annotations can span parts of multiple paragraphs, one half of a custom XML
markup element's contents, and so on.) In these cases, the annotation's region is delimited by two
elements, a start element and an end element, which mark the start and end points of the annotated
content, respectively, but do not contain it. Matching start and end markers have the same id attribute
value.
Consider the following WordprocessingML markup for two paragraphs, each reading Example Text,
where a bookmark has been added spanning the second word in paragraph one, and the first word in
paragraph two:
ECMA-376 Part 1
Example
text.
Example
text.
The bookmarkStart and bookmarkEnd elements specify the location where the bookmark starts and
ends, but cannot contain that bookmark because it spans parts of two paragraphs. They are part of one
group because the id attribute value specifies 0 for both.
L.1.14.4 Property Annotations
A property annotation is a form of annotation that is stored as a property on an object (Property
annotations can appear on paragraph properties, run properties, table rows, and so on.) In these cases,
the annotation's semantics are defined by the property, as they can affect content and/or formatting.
Consider the following WordprocessingML markup for a paragraph reading Example Text, where the
first word had the bold property applied when the editing application was tracking revisions:
Example
Annex L
text.
The rPrChange element contains the set of previously applied revision properties associated with a
particular author at a particular time. It is stored itself as a property on the parent run which was
modified.
L.1.14.5 Comments
A comment is an annotation that is anchored to a region of document content, but which contains an
arbitrary amount of block-level content stored in its own separate document story. Within a
WordprocessingML document, comments are stored in a separate comments part within the document
package.
A comment in a WordprocessingML document is divided into two components:
The comment anchor (the text to which the comment applies)
The comment content (the contents of the comment)
The comment anchor is the cross-structure annotation that defines the region of text on which the
comment in anchored. The comment content is the text of the comment.
Consider a paragraph in a WordprocessingML document whose second word is annotated with a
comment:
The first component to this comment is the document content, which defines the extents of the
comment and references the specific comment in the comments part:
Some
text.
ECMA-376 Part 1
The commentRangeStart and commentRangeEnd elements delimit the run content to which the
comment with an id of 0 applies (in this case, the single run of text). The commentReference element
that follows links the preceding run content with a comment in the comments part having an id of 0.
Without all three of these elements, the range and comment cannot be linked (although the first two
elements are optional, in which case the comment must be anchored at the comment reference mark)
The second component to this comment is the comment content, which defines the text in the
comment:
comment
In this example, the comment specifies that it was inserted by author Joe Smith with the initials User
via the author and date attributes. It is linked to the run content via the id attribute, which matches the
value of 0 specified using the commentReference element above. The block-level content of the
comment specifies that its text is comment and the style of the comment content is based off of the
character style with the name CommentReference.
L.1.14.6 Comments Part
Comment information in a WordprocessingML document is stored in the Comments part within the
package, which is stored via an implicit relationship from the Main Document or Glossary Document
part of relationship type http://…/comments and has a content type of vnd-
openxmlformats.officedocument.wordprocessingml-comments+xml.
L.1.14.7 Revisions
A revision provides a mechanism for storing information about the evolution of the document (i.e., the
set of modifications made to a document by one of more authors). When an application adds revisions
Annex L
to the content of a WordprocessingML document, depending on the revision type they are specifying
this by storing either:
The current state of the document (a deletion stores the current state of the text as deleted,
and implies that its original state was the content that used to exist)
The initial state of the document (a run's initial properties are explicitly stored in a previous run
properties block, as the current run properties are always those that are the child of the
rPr element
A revision consists of two required pieces of information:
The revision type (specified via the name of the revision element)
A unique revision identifier (used to uniquely identify revisions)
As well as optional information:
The author of the revision
The date and time of the revision
A revision is stored using the inline annotation format or the property annotation format.
Consider a paragraph of text in a WordprocessingML document in which one word has been inserted, as
follows:
This paragraph has the word text marked inserted as a revision, and is represented as the following
WordprocessingML:
Some
text
The ins element contains all of the content that must be treated as revision marked as inserted (i.e., the
word text).
This means that it contains both required pieces of information: the revision type, specified by the name
of the revision element (ins); and a unique revision identifier of 0.
ECMA-376 Part 1
The element also stores the optional information about the revision: the word text was inserted by
Joe Smith on March 31, 2006 at 12:50 pm.
Within a WordprocessingML document, the following types of revisions can be used to track the
changes to a document (each annotation's form in parentheses):
Insertions (inline annotations for run content, property annotations for tables and paragraphs)
Deletions (inline annotations for run content, property annotations for tables and paragraphs)
Moves (inline annotations)
Changes to run/paragraph/table/numbering/section properties (property annotations)
Changes to custom XML markup (property annotations)
L.1.14.8 Bookmarks
A bookmark refers to an arbitrary region of content that is bounded and has a unique name associated
with it.
Because bookmarks are a legacy word-processing function that predates the concepts of XML and well-
formedness, they can start and end at any location within a document's contents and, therefore, must
use the cross-structure annotation format described in §L.1.14.3.
Consider the following WordprocessingML markup for two paragraphs, each reading Example Text,
where a bookmark has been added spanning the second word in paragraph one and the first word in
paragraph two:
Example
text.
Example
text.
Annex L
The bookmarkStart and bookmarkEnd elements specify the location where the bookmark starts and
ends, but cannot contain it using a single tag because it spans parts of two paragraphs. However, the
two tags are part of one group because the id attribute value specifies 0 for both.
L.1.14.9 Range Permissions
A range permission refers to a special type of bookmark used to control which subset(s) of users can edit
a particular region of a document. Range permissions specify the user, or set of users, that are allowed
to edit all content between them whenever the document protection specified by the
documentProtection element is enabled and set to readOnly or comments.
Like bookmarks, range permissions are a legacy word-processing function that predates the concepts of
XML and well-formedness, so they can start and end at any location within a document's contents and,
therefore, must use the cross-structure annotation format described in §L.1.14.3.
Consider the following WordprocessingML markup for a single paragraph, where a range permission has
been added spanning the words range permission:
This is a
range permission
.
The permStart and permEnd elements specify the location where the range permission starts and ends.
The two tags are part of one group because the id attribute value specifies 0 for both.
If document protection was enabled, then no content in this document must be editable except for this
range permission, which is editable by all users that open the document (specified using an editor group
of everyone).
L.1.14.10 Spelling and Grammar
A spelling and grammar error is an annotation used to specify the locations of an existing spelling and/or
grammatical error within the contents of a document. Spelling and grammar errors use the cross-
structure annotation format.
ECMA-376 Part 1
Rationale: When a WordprocessingML document is saved, applications can choose to save currently
flagged spelling and grammar errors, for two reasons:
In order to increase the performance subsequent loads of the document (as those load
operations can rely on the persisted proofing state of the document)
In order to store words which must not be marked as proofing errors regardless of how they
would normally be flagged by the proofing tools engine (i.e., to store spelling and grammar
exceptions).
Consider the following paragraph consisting of two misspelled words, where the second word has been
explicitly flagged as not being a spelling error. This paragraph would consist of the following
WordprocessingML markup:
erqwt
werewr
The proofErr elements, with a val attribute value of spellStart and spellEnd, respectively, delimit
the start and end of the content in this paragraph that is stored as a spelling error. Since the second
word is not included in that range, it is not stored as a spelling error.
L.1.15 Mail Merge
Mail merge refers to a process by which a WordprocessingML document is connected to and populated
with external data by a conforming hosting application and/or data source access application. A
WordprocessingML document that contains the necessary data to connect to an external data source
during a Mail Merge is known as a source document. In other words, a source document is a
WordprocessingML document containing the elements and attributes necessary to enable the
document to connect to an external data source, but not yet merged with any data.
Applications leverage source documents to generate new documents containing the static content
contained in the merged document as well as data from the specified external data source. The
documents that result from importing external data into a source document are known as merged
documents. How source documents and merged documents are specified is explained in the following
sections.
L.1.15.1 Mail Merge, WordprocessingML, and Hosting Applications
The two key parts of the mail merge process are:
Annex L
1. Connecting to an external data source
2. Populating mail merge fields with external data
It is important to note that aspects of the mail merge process outside of connecting to an external data
source and populating mail merge fields with external data, are at the discretion of the hosting
application.
As an additional example, WordprocessingML provides an element to be used as a flag by hosting
applications to specify action to be taken on the merged documents that are generated by a mail merge.
In other words, performing actions such as:
creating a new document for each merged document
generating and sending emails containing merged document
printing merged documents
can be specified through WordprocessingML, but what if any specific action is taken on merged
documents is determined by the application.
L.1.15.2 Connecting Documents to an External Data Source
As mentioned, a source document is the single WordprocessingML document that contains the data
necessary to be connected to an external data source by a conforming hosting application and/or data
source access application. The presence and parameters of this connection are specified within the
mailMerge element. This element enables WordprocessingML documents to be connected to an
external data source by specifying the following data:
Where the external data is located (e.g., file path)
What type of data the external data source contains (e.g., database and spreadsheet)
How the data is accessed
Consider a document containing static WordprocessingML constructs such as paragraphs in addition to
two WordprocessingML mail merge fields calling for Courtesy Title and Last Name data.
ECMA-376 Part 1
Dear {MERGEFIELD "Courtesy Title" \m}
{MERGEFIELD "Last Name" \m},
Sample text. Sample text. Sample text.
Sample text. Sample text. Sample text. Sample
text. Sample text. Sample text. Sample text.
Sample text. Sample text. Sample text. Sample
text. Sample text. Sample text. Sample text.
Sample text. Sample text. Sample text. Sample
text. Sample text. Sample text. Sample text.
Sample text.
Sincerely,
If the following WordprocessingML was added to this document, this document would become a source
document rather than just a standard WordprocessingML document, as the mailMerge element
specifies the elements and attributes necessary to enable the hosting applications and/or data source
access applications to connect the document to an external data source.
…
…
Here, the dataType and dataSource elements specify that the given document must be connected to
the external data source referenced by the r:id attribute's value of rId1. While connected to the
external data source, the merged document together with the hosting application and/or data source
access application can extract data from the external data source as specified by the connectString and
query elements.
L.1.15.3 Populating Merged Documents with External Data
Before the hosting application can populate merged documents with external data, mail merge fields
must be inserted into the merged document and mapped to the external data. How external data is
mapped to given mail merge fields is determined by the WordprocessingML element fieldMapData.
Annex L
Consider the example merged document from the previous example which contained the two mail
merge fields calling for Courtesy Title and Last Name. The WordprocessingML below
demonstrates how mapping of the external data to the merged document's mail merge fields occurs:
Within the first fieldMapData element, the child elements column, name, type, and mappedName
specify that the data contained within tenth column titled 'Customer Title', in the specified external
database, is to be mapped to the mail merge field calling for 'Courtesy Title' data, respectively. Within
the second fieldMapData element, the child elements column, name, type, and mappedName specify
that the data contained within eleventh column in the specified external database is to be mapped to
the merge field titled Customer Last Name or the predefined merge field name Last Name.
Once a merged document's mail merge fields have been mapped to external data, the hosting
application and/or data source access application can populate the respective fields with applicable
external data.
Consider a conforming hosting application and/or data source access application that wishes to
populate the mail merge fields within the merged document from the previous example with applicable
external data. In addition, consider that the specified external data source contains two records--one for
Mr. John Doe and one for Ms. Jane Smith. With external data from the Customer Title column
mapped to the Mail Merge field calling for Courtesy Title data, and the Customer Last Name
column mapped to the Mail Merge field calling for Last Name data to populate the fields within this
merged document with external data.
The mail merge process then runs through the specified external database and populate the mail merge
fields with the data from the Customer Title and Customer Last Name columns in the specified
database, and generate two of merged documents containing the specified external data as well as the
static contents of the source document (illustrated in the table below):
ECMA-376 Part 1
Source Document Merged document populated Merged document populated
with first external data source with second external data
entry source entry
Dear{MERGEFIELD "Courtesy Dear Mr. Doe: Dear Ms. Smith:
Title" \m} {MERGEFIELD "Last
Name" \m}, Sample text. Sample text. Sample text. Sample text.
Sample text. Sample text. Sample text. Sample text.
Sample text. Sample text. Sample Sample text. Sample text. Sample text. Sample text.
text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text.
Sample text. Sample text. Sample Sample text. Sample text. Sample text. Sample text.
text. Sample text. Sample text. Sample text. Sample text. Sample text. Sample text.
Sample text. Sample text. Sample Sample text. Sample text. Sample text. Sample text.
text. Sample text. Sample text. Sample text. Sample text.
Sincerely, Sincerely, Sincerely,
L.1.16 Settings
A setting specifies a stored preference that must be used when processing the contents of the
document. In other words, settings refer to specified behaviors that must be applied to
WordprocessingML documents on a document by document basis. Just like paragraphs and text runs
have properties specified that apply to their contents, entire WordprocessingML documents leverage
settings to specify properties and behaviors that apply to the entire document.
These settings are typically divided into three categories:
Document Settings — Settings that influence the appearance and behavior of the current
document, as well as storing document-level state.
Compatibility Settings — Settings that tell applications to perform behaviors which are designed
to maintain visual output of previous word-processing applications.
Web Settings — Settings that affect how a document must be handled when it is saved as HTML.
L.1.16.1 Document Settings
A document setting specifies a document-level property that affects the handling of a given document,
and influences the appearance and behavior of the current document, as well as the stored document-
level state. All document settings are found in the Document Settings part.
Consider a document in which the document setting doNotHyphenateCaps is applied. As a document
setting this element specifies whether words comprised of all capitalized letters must be hyphenated or
not throughout the given document.. Specifically, if words in ALL CAPITAL LETTERS must not be
hyphenated, this requirement would be specified by adding the following WordprocessingML to the
settings part:
Annex L
Specifying that words comprised of ALL CAPITAL LETTERS must be hyphenated, as illustrated below:
If this element is omitted, then words in ALL CAPITAL LETTERS must be hyphenated when the document
is hyphenated, as illustrated below:
L.1.16.2 Compatibility Settings
A compatibility setting is an optional setting used to mimic behavior of documents created in earlier
word-processing applications. It is recommended that new WordprocessingML documents contain no
compatibility settings. If compatibility settings are needed, they are stored in the Document Settings
part (§L.1.16.1).
Consider a document in which the compatibility setting ww11IndentRules is applied. As a compatibility
setting, this element specifies an indentation behavior to be applied throughout the given document to
preserve visual fidelity with an earlier word processing application. Specifically, if the indentation
applied to numbering when positioned next to a wrapped object must not be suppressed, this
requirement would be specified by adding the following WordprocessingML to the settings part
Specifying that indentation applied to numbering when positioned next to a wrapped object must not
be suppressed, as illustrated below:
If this element is omitted, then indentation applied to numbering when positioned next to a wrapped
object must be suppressed, as illustrated below:
ECMA-376 Part 1
L.1.16.3 Web Settings
A web setting is a setting used to specify a document-level property that is applicable when saving a web
page as a WordprocessingML document, or when saving a WordprocessingML document as a webpage.
Thus, if a given WordprocessingML document was not created from a web page, and never becomes a
web page, no web settings are needed within the document. If they are needed, web settings are stored
in the Web Settings part.
Consider a document in which the web setting allowPNG is applied. As a web setting, this element
specifies if the PNG graphics format is used for persisting images when saving the document as a web
page. Specifically, if the PNG graphics format is used when saving a document as a web page, this
requirement would be specified by adding the following WordprocessingML to the settings part:
If this element is omitted, then the JPEG graphics format is used for persisting images when saving the
document as a web page.
L.1.17 Fields and Hyperlinks
L.1.17.1 Fields
Most text in a word processing document is static; that is, unless it is directly changed as the result of
editing, its contents remain the same, no matter how the rest of the document might change. However,
certain useful pieces of information can change value over the life of a document. Consider the case of a
reference to a page number, as in "For more information on this topic, see page 56." Clearly, hard
coding the page number as 56 means that that number needs to be manually replaced as the
document's size or layout is changed. Even a simple change to any margin, line spacing, or font size can
invalidate such references.
Fields provide a mechanism for placeholders, such as page reference numbers, that can be added to a
document such that those placeholders are replaced by their corresponding values when the document
is rendered for display or print. Other applications for fields include, but are not limited to, automatic
numbering of tables and figures, document creation and current date and time, document author
information, and the computation of totals for a table column.
A field is a set of codes that instructs a WordprocessingML consumer to insert text, graphics, page
numbers, and other material into a document automatically. (The DATE field causes the current date to
Annex L
be inserted.) The text or graphics inserted into a document when a consumer carries out a field's codes
is referred to as the field result for that field. The act of carrying out a field's codes is referred to as a
field update. As to how or when any field is updated is outside the scope of ECMA-376.
L.1.17.2 Hyperlinks
As well as allowing for dynamic run content using fields, a WordprocessingML document can contain
one or more hyperlinks, which allow for the linking of two disparate regions of WordprocessingML
content (analogous to hyperlinks in HTML pages). WordprocessingML hyperlinks can be any of the
following:
Intradocument: A hyperlink can target any bookmark contained within the current
WordprocessingML document.
Interdocument: A hyperlink can target another WordprocessingML package, as well as specify a
bookmark within that package.
Other destinations: A hyperlink can target any other URI location.
L.1.18 Miscellaneous Topics
L.1.18.1 Text Boxes
All VML-based drawing objects (except for connectors) support the addition of rich WordprocessingML
content within their extents. When WordprocessingML contents have been added to a drawing object,
the resulting text is contained within a text box.
When WordprocessingML content is contained within a text box, the text is represented within a single
txbxContent element that contains all of the desired WordprocessingML content. Text box content
cannot contain references to other document stories, nor can it contain other txbxContent elements.
That is, nested shapes cannot have rich content.
L.1.18.2 Subdocuments
Within a WordprocessingML document, it is sometimes necessary to break a large document into two or
more separate WordprocessingML document files, allowing each of these files to be distributed, edited,
and handled independently.
A book might consist of five chapters, each edited by a separate author. The editor for the book would
therefore desire to create six WordprocessingML documents - one for each author to work on their
chapter, and a main document which collates the content of the five chapters appropriately.
When a WordprocessingML document is composed of other WordprocessingML documents in this way,
the resulting documents are a master document and its subdocuments.
A master document is a document which incorporates one or more subdocuments (as well as
optional WordprocessingML content) to create a larger document
A subdocument is a WordprocessingML document—there is no specific information in a
document which classifies it as such
ECMA-376 Part 1
Consider a WordprocessingML document, which is being used to write a book:
To allow this document to be written by multiple authors, each chapter in the book is placed in a
separate file (the sections highlighted in red below):
The result is three WordprocessingML documents:
A master document (containing the title of the book, the first paragraph, and references to the
subdocuments for each chapter)
Two subdocuments (one for each chapter)
Annex L
L.1.18.3 Importing External Content
When generating WordprocessingML documents, it is sometimes necessary to include existing
document content (henceforth called external content) within the document. External content in a
document is typically included because it was stored in a format other than the WordprocessingML
format defined by this Office Open XML specification.
In order to facilitate the inclusion of such content without requiring its conversion as a prerequisite to its
inclusion in a document, WordprocessingML includes the facility for applications to implement the
import of external content in any format as part of a WordprocessingML document. This functionality,
called external content import, allows the inclusion of content of an arbitrary content type within the
WordprocessingML package, which can then be opened and merged into the main document when the
package is consumed by applications which understand that content type.
Consider a WordprocessingML document which is being created based on the following existing HTML
content:
Paragraph one.
Paragraph in a
blockquote.
Paragraph two.
This content can be converted to its WordprocessingML equivalents using the XML syntax defined by
this Office Open XML specification, or a more basic tool can use the external content import to include
the HTML document within a WordprocessingML package, allowing a subsequent consumer of that
content to import the resulting HTML. When the resulting WordprocessingML package is opened, if it is
an alternate format understood by the consuming application, the HTML document must be opened and
migrated into the appropriate location in the main WordprocessingML document.
L.1.18.4 Roundtripping Alternate Content
Office Open XML defines a mechanism for the storage of content which is not defined by this Office
Open XML specification, for example extensions developed by future software applications which
leverage the Office Open XML formats. This mechanism allows for the storage of a series of alternative
representations of content, of which the consuming application can use the first alternative whose
requirements are met.
Consider an application which creates a new paragraph property intended to make the colors of its text
change randomly when it is displayed. This functionality is not defined in this Office Open XML
specification, and so the application might choose to create an alternative representation setting a
ECMA-376 Part 1
different manual color on each character for clients which do not understand this extension using an
AlternateContent block as follows:
Random colors!
R
a
…
The Choice element that requires the new color extensions uses the random element in its namespace,
and the Fallback element allows clients that do not support this namespace to see an appropriate
alternative representation.
These alternate content blocks can occur at any location within a WordprocessingML document, and
applications must handle and process them appropriately (taking the appropriate choice).
However, WordprocessingML does not explicitly define a set of locations where applications must
attempt to store and roundtrip all non-taken choices whenever possible.
If an application does not understand the colors extension, the resulting file (if alternate choices are to
be preserved would appear as follows:
Annex L
…
…
The file would then appear as follows after the choice is processed:
R
a
…
L.1.18.5 Use of Different Calendar Systems
Office Open XML supports the use of the following calendars:
Gregorian
Hebrew Lunar
Hijri Lunar
Japanese Emperor Era
Korean Tangun Era
Saka Era
Taiwanese
Thai Buddhist
These calendars are enumerated in the ST_CalendarType simple type, and can be used in
WordprocessingML, e.g.:
Structured Document Tag calendar formats (§17.5.2.3)
ECMA-376 Part 1
Date-based Fields (§17.16.5.11, §17.16.5.13, §17.16.5.47, §17.16.5.53)
As an illustration, the calendars supported by ST_CalendarType (§22.9.2.1) can be displayed through the
date and time fields as shown below:
Calendar Type Field Instructions Result
(on 2007-12-
17T00:00.00)
Gregorian DATE \@ "d MMMM yyyy" 17 December 2007
Hebrew Lunar DATE \@ "d MMMM yyyy" \h 8 Tevet 5768
The language component of the BCP 47
language code used by the lang element
(§17.3.2.20) on the run containing the
field instructions equals he.
Hijri Lunar DATE \@ "d MMMM yyyy" \h 8 Thoul Hijjah 1428
The language component of the BCP 47
language code used by the lang element
(§17.3.2.20) on the run containing the
field instructions equals ar.
Japanese Emperor DATE \@ "d MMMM ee" 17 December 19
Era
Korean Tangun Era DATE \@ "d MMMM ggg" 17 December 단기
The language component of the BCP 47
language code used by the lang element
(§17.3.2.20) on the run containing the
field instructions equals ko.
Saka Era DATE \@ "d MMMM yyyy" \s 26 Agrahayana 1929
Taiwanese DATE \@ "d MMMM ggg" 17 December 平成
The lang element (§17.3.2.20) on the run
containing the field instructions equals
zh-TW.
Thai Buddhist Era DATE \@ "d MMMM bbbb" 17 ธันวาคม 2550
L.2 Introduction to SpreadsheetML
This clause contains a detailed introduction to the structure of a SpreadsheetML document.
Annex L
L.2.1 Workbook
L.2.1.1 Overview
A workbook is composed of book-level properties and a collection of one or more sheets. The sheets are
the central working surface for a spreadsheet application. The workbook part and corresponding
properties comprise data used to set application- and workbook-level operational state. The workbook
also serves to bind all the sheets and child objects into an organized single file. The workbook properties
include information about what application last saved the file, where and how the windows of the
workbook were positioned, and an enumeration of the worksheets in the workbook.
L.2.1.2 Minimum Workbook Scenario
For the sake of simplicity, it is important to minimize the required set of workbook properties that must
be present to compose a conformant SpreadsheetML workbook. The smallest possible (blank) workbook
must contain the following:
A single sheet
A sheet ID
A relationship Id that points to the location of the sheet definition
For example:
L.2.1.3 Example Workbook Properties
Consider the following graphical representation of a workbook:
ECMA-376 Part 1
The above example has the following workbook properties definition:
The elements and attributes used here are discussed in more detail in the following subclauses.
Annex L
L.2.1.4 fileVersion
This contains file versioning properties, as follows.
lastEdited – The version of the application that last saved the file.
lowestEdited – The earliest version of the application that saved the file. This value is reset any
time an application that understands all data in the file saves the file.
rupBuild – An incremental public release of the application (e.g., RTM version or SP1 version).
workbookPr – A group of various workbook properties.
backupFile – A flag that indicates whether the application should create a backup of the file in
question during a save operation.
saveExternalLinkValues – A flag that indicates whether the application should cache values
retrieved from other workbooks via an externally linking formula during save. If yes, a
supporting part is written out containing a cached cell table from the external workbook.
updateLinks – A flag that dictates how external links are handled upon opening the file. In this
example, never means don't ask the user if they want to refresh the cached values from an
external workbook, and in fact, don't ever do it until the user initiates the action.
calcPr – Various calculation properties grouped together.
calcId – The version of the calculation engine used to calculate values in the workbook. When a
newer version of the application opens a file with an older calcId value, the application
performs a full calculation of all formulas immediately after opening the workbook, to ensure
proper calculation results.
calcMode – A flag that indicates when the application should calculate formulas:
Manual means to wait for the user to initate the action.
Automatic means to perform only the needed calculations whenever a cell value changes.
Iterate – When formula references are circular (i.e., they refer back on themselves for required
input), the iterate flag specifies that this is an intended state. Further properties not discussed
here control the number of iterative calculations to perform before stopping calculation.
bookViews – A collection of views.
L.2.1.5 workbookView
A single view definition represented using the following flags:
showHorizontalScroll – Controls visibility of the horizontal scroll bar of the application. In the
example above, it is set to not being visible.
showVerticalScroll – Controls visibility of the vertical scroll bar of the application. In the example
above, it is set to not being visible.
showSheetTabs – Controls visibility of the worksheet tabs in the application. In the example
above, they are set to not being visible.
xWindow – Specifies the x coordinate (in twips) of the upper right corner of the workbook
window.
ECMA-376 Part 1
yWindow – Specifies the y coordinate (in twips) of the upper right corner of the workbook
window.
windowWidth – Specifies the width of the workbook window.
windowHeight – Specifies the height of the workbook window.
tabRatio – Specifies the ratio between the workbook tabs bar and the horizontal scroll bar.
Sheets – A collection of worksheets in the workbook.
Sheet – A single sheet definition (book-level).
Name – The name of the worksheet. These must be unique within the workbook.
sheetId – The internal Id of the sheet. These must be unique within the workbook.
Id - The relationship Id that points to the sheet part definition.
L.2.2 Sheets
Sheets are the central structures within a workbook, and are where a user does most of his spreadsheet
work. The most common type of sheet is the worksheet, which is represented as a grid of cells.
Worksheet cells can contain text, numbers, dates, and formulas. Cells can also be formatted. A
workbook usually contains more than one sheet. To aid in the analysis of data and the making of
informed decisions, spreadsheet applications often implement features and objects which help
calculate, sort, filter, organize, and graphically display information. Since these features are often
connected very tightly with the spreadsheet grid, these are also included in the sheet definition on disk.
Other types of sheets include chart sheets and dialog sheets.
L.2.2.1 Minimum Worksheet Scenario
The smallest possible (blank) sheet is as follows:
The empty sheetData collection represents an empty grid; this element is required. As defined in the
schema, some optional sheet property collections can appear before sheetData, and some can appear
after. To simplify the logic required to insert a new sheetData collection into an existing (but empty)
sheet, the sheetData collection is required, even when empty.
L.2.2.2 Example Sheet
Consider the following graphical representation of a worksheet:
Annex L
=‘C:\[ExternalBook.xlsx]Sheet1’!$A$1
Notice that cells A2 and A3 contain text. Cell B1 contains a formula linking to another workbook, whose
value is 1. Cell B2 contains a formula as well; this formula appears in the formula bar (top of picture)
because it is the active cell. Cells D5:H5 contain bold-faced text that serves as headers for the table of
data residing in D6:H11. The table of data has a filter feature applied to it (evidenced by drop down
arrows in the header row), and columns G and H have different types of conditional formatting applied.
Finally, cells D13:H14 are part of a merged cell feature, where a series of cells behave together as a
single, larger cell.
When saved, the above example has the syntax below written out in the corresponding sheet part.
Sheet information is organized into three main sections:
1. Top-level sheet properties (everything before sheetData)
2. The cell table (sheetData)
3. Supporting sheet features (everything after sheetData)
Therefore, the XML for the above example would look like this, broken into three sections:
L.2.2.3 Sheet Properties
ECMA-376 Part 1
L.2.2.4 Sheet Data
sheetData, which represents the cell table, directly after the cols collection:
0
[1]Sheet1!$A$1
1
1
B2+1
2
4
Annex L
5
6
7
8
2
0.18460660235998017
0.93463071023892952
0.58647760893211043
SUM(E6:G6)
1.7057149215310201
2
0.50425224796279555
0.25118866081991786
ECMA-376 Part 1
0.26918159410869791
SUM(E7:G7)
1.0246225028914113
2
0.6006019062877066
0.18319235857964333
0.12254334000604317
SUM(E8:G8)
0.9063376048733931
2
0.78015011938458589
0.78159963723670689
6.7448346870105036E-2
Annex L
SUM(E9:G9)
1.6291981034913978
3
0.63608141933645479
0.35635845012920608
0.67122053637107193
SUM(E10:G10)
1.6636604058367328
3
0.33327331908137214
0.2256497329592122
0.5793989116090501
SUM(E11:G11)
1.1383219636496344
ECMA-376 Part 1
9
L.2.2.5 Supporting Features
The supporting feature definitions follow the cell table data:
MAX(IF(ISBLANK(H6:H11), "", IF(ISERROR(H6:H11), "",
H6:H11)))
MIN(IF(ISBLANK(H6:H11), "", IF(ISERROR(H6:H11), "",
H6:H11)))
Annex L
0.5
These elements are discussed in more detail in the following subclauses.
L.2.2.6 Sheet Properties
Referring back to §L.2.2.3, note that several sheet-level properties are expressed before the sheetData
cell table is encountered.
sheetPr indicates that an AutoFilter has been applied on this sheet. Dimension indicates the used range
on this sheet. There should be no data or formulas outside this range. The sheetViews collection
indicates which cell is active on the sheet, and indicates whether this particular sheet is the active sheet
in the workbook.
A collection of column-level settings appears in the cols collection.
Finally, within sheetFormatPr, a default row height is set.
L.2.2.7 sheetData Cell Table
The cell table is the core structure of a worksheet. It consists of all the text, numbers, and formulas in
the grid.
L.2.2.8 Row
0
ECMA-376 Part 1
[1]Sheet1!$A$1
1
The cells in the cell table are organized by row. Each row has an index (attribute r) so that empty rows
need not be written out. Each row indicates the number of cells defined for it, as well as their relative
position in the sheet. In this example, the first row of data is row 2.
L.2.2.9 Cell
B2+1
2
The cell itself is expressed by the c collection. Each cell indicates it's location in the grid using A1-style
reference notation. A cell can also indicate a style identifier (attribute s) and a data type (attribute t).
The cell types include string, number, and Boolean. In order to optimize load/save operations, default
data values are not written out.
L.2.2.9.1 Cell Values
Cells contain values, whether the values were directly entered (e.g., cell A2 in our example has the value
External Link:) or are the result of a calculation (e.g., cell B3 in our example has the formula B2+1).
String values in a cell are not stored in the cell table unless they are the result of a calculation.
Therefore, instead of seeing External Link: as the content of the cell's v node, instead you see a
zero-based index into the shared string table where that string is stored uniquely. This is done to
optimize load/save performance and to reduce duplication of information. To determine whether the 0
in v is a number or an index to a string, the cell's data type must be examined. When the data type
indicates string, then it is an index and not a numeric value.
L.2.2.9.2 Formulas
Cells can contain formulas, which calculate results. Formulas are expressed in the file the same way the
user sees them at runtime of the application. This is specifically a design choice meant to aid in creation
and processing of workbook contents.
A formula can have attributes on it indicating how to handle calculation of the cell.
Annex L
L.2.2.9.2.1 Shared Formulas
SUM(E7:G7)
1.0246225028914113
SUM(E8:G8)
0.9063376048733931
Just as strings in cells can be extremely pervasive and redundant in a sheet (and therefore must be
optimized), formulas are also extremely pervasive in a sheet, and often can be optimized. Consider the
table in the above example, where column H contains a formula that sums the numbers in columns E
through G, for each row. The only difference between the formulas in H6:H12 is that the reference
increases by 1 row from one row to the next. Therefore, an optimization is created where only the
formula in H6 needs to be written out, with some additional information indicating how far to propagate
the formula once loaded. This enables the loading application to load and parse only the first of the
shared formulas, and then more quickly apply the necessary transforms to produce the additional
related formulas in subsequent cells.
Note that while formulas can be shared, it is desirable to enable easy access to the contents of a cell.
Therefore, it is allowed that all formulas can be written out, but only the primary formula in a shared
formula need be loaded and parsed.
L.2.2.9.2.2 External Referencing Formulas
[1]Sheet1!$A$1
1
In the above example, cell B2 contains a formula that references a cell in another workbook, namely
‘C:\[ExternalBook.xlsx]Sheet1’!$A$1. This formula is referencing ExternalBook.xlsx
located at c:\. Furthermore, the formula is requesting the value of cell A1 on Sheet1 of that particular
workbook.
Instead of writing ‘C:\[ExternalBook.xlsx]Sheet1’!$A$1 directly in the formula, it is desirable
to make all external references much more accessible, especially given the potentially enormous size of
a cell table. Therefore, the URL and file location is persisted using the relationships semantic, in a
ECMA-376 Part 1
relationship file, and then referenced inline with the formula: [1]Sheet1!$A$1. In this way, external
resource files can more easily be determined and updated if needed.
Note that whenever a workbook contains a formula referencing another workbook, some values from
that external workbook are also cached with the referencing workbook. This is done so that if a
recalculation of the workbook is needed and the workbook isn't accessible, a cached value can be used
to complete the calculation.
L.2.2.10 Supporting Sheet Features
L.2.2.11 Defined Names
Sheet1!$B$3
Sheet1!$B$3
Defined names can be used in place of cell references in formulas. For example, instead of using B3+1 to
add 1 to the value that's in B3, one could define a name, as in FMLA, and assign it to B3. Then FMLA+1
can be used to perform the calculation.
Names can be defined and assigned to a cell location or range or to a formula or constant value. Names
can be referenced in formulas. Names can be scoped to either the entire workbook (default) or just the
local sheet. Names scoped to the local sheet cannot be referenced from other sheets. Names scoped to
the workbook can be referenced from any sheet.
Defined names are actually stored in the workbook part, but are discussed here in the context of the
sheet because they are so closely related to cells and formulas.
L.2.2.12 AutoFilter
Annex L
AutoFilters specify criteria for which cells in a table should be displayed. In this example, the first column
(zero-based index colId) in the table (cells D5:D11) has a criterion specifying that only rows in the table
whose values in column D are equal to A are shown. The rest of the rows are hidden.
A second criterion is specified as well, on the 2nd column, E: only rows whose values in column E are
greater than 0 and less than 0.7.
The resulting grid could be rendered like this:
L.2.2.13 Merged Cells
In the example, cells D13:H14 have been merged into a single, larger cell. Note that the cell table itself
doesn't reflect this merge, but it does reflect the data content and formatting. Specifically, the top-left
cell in a merged collection of cells contains the value, and all the cells reflect the various border
formatting.
ECMA-376 Part 1
L.2.2.14 Conditional Formatting
MAX(IF(ISBLANK(H6:H11), "", IF(ISERROR(H6:H11), "",
H6:H11)))
MIN(IF(ISBLANK(H6:H11), "", IF(ISERROR(H6:H11), "",
H6:H11)))
0.5
There are two conditional formats applied: one to the table of data in column H and the other to the
table of data in column G.
In column G, a red fill is applied to any cell whose value is greater than 0.5. Notice that sqref specifies
the range to which the rule applies. The formatting is specified by dxfId, which is a reference to a
formatting expression in the central styles part.
In column H there is a dataBar formatting rule, which applies a variable length bar to the cell
background, where the length of the bar depends on the relative value of the cell.
L.2.3 Shared String Table
L.2.3.1 Overview
A workbook can contain thousands of cells containing string (non-numeric) data. Furthermore, this data
is very likely to be repeated across many rows or columns. The goal of implementing a single string table
that is shared across the workbook is to improve performance in opening and saving the file by only
reading and writing the repetitive information once.
For example, consider a workbook summarizing information for cities within various countries. There
can be a column for the name of the country, a column for the name of each city in that country, and a
column containing the data for each city:
Annex L
In this case, the country name is repetitive, being duplicated in many cells. In many cases, the repetition
is extensive, and a tremendous savings is realized by making use of a shared string table when saving the
workbook.
L.2.3.2 File Architecture
Workbook
Shared Sheet1 Sheet
Strings 2
There is a single shared strings part for all the strings in a workbook. This part is related to the
workbook. Each cell (in sheet1.xml, for example) containing a string value refers by index to a string
ECMA-376 Part 1
expressed in the shared strings part. The solid arrows represent relationships among the parts and the
dotted arrows represent references by index to a string in the shared strings part.
L.2.3.3 Example: Plain Text
This first example demonstrates plain text in cells. Note that in this example, some of the cells are
formatted (e.g., the column headers "Country", "City", and "Data" are bold faced). Since the formatting
is applied at the cell level, cell styles and formatting is used to describe the formatting, rather than using
text formatting on the text itself.
A later example demonstrates how to handle a variety of text formatting (rich text) within a single cell.
L.2.3.4 Illustration
Consider the example in the introduction:
In this example, the country names in the column titled 'Country'—"United States", "Argentina", and
"Japan"—would appear a single time in the shared strings part. Additionally, all the city names (in the
column titled 'City') would appear a single time in the shared strings part, as would the column titles
themselves in B2:D2. The numeric values in the 'Data' column would be expressed inline with the cell
table definition (e.g., in Sheet1.xml).
L.2.3.5 The XML
The shared string table XML for this example looks like this:
Annex L
United States
Seattle
Denver
New York
Philadelphia
Houton
San Diego
San Francisco
Argentina
Buenos Aires
San Juan
Salta
Rosario
La Plata
ECMA-376 Part 1
Japan
Tokyo
Nagoya
Yokohama
Sendai
Country
City
Data
The cell table for this example looks like this:
19
20
21
0
Annex L
1
ROUND(RAND()*1000,2)
374.9
0
2
452.82
0
3
632.1
0
4
ECMA-376 Part 1
886.37
0
5
291.14
0
6
114.97
0
7
291.99
Annex L
8
9
335.42
8
10
664.72
8
11
992.62
8
12
ECMA-376 Part 1
148.5
8
13
193.53
14
15
849.36
14
16
765.46
Annex L
14
17
350.26
14
18
979.22
L.2.3.6 Shared String Table
United States
Seattle
Denver
Examining the XML for the shared string part, it can be found that the first entry in the string table is
"United States", residing in position 0. The value "Seattle" can be found in position 1 and "Denver" can
be found in position 2.
ECMA-376 Part 1
L.2.3.7 Cell Table
19
20
21
The first cell in our spreadsheet that contains data is B2. The XML indicates that it is of data type 'string'
(t="s"). This indicates that the numeric value found inside the element is an index to a string in the
string table rather than an actual number in the spreadsheet. The value for cell B2 is '19'. The 19th entry
in the shared string table (counting the first entry as 0) has a value of "Country". Therefore, cell B2
contains the word "Country".
0
1
ROUND(RAND()*1000,2)
374.9
Cell B3 () is also of data type string, and the '0' inside the v element refers to the
0th item in the string table, which corresponds to the string value "United States". Cell C3 is a string type
of cell and references the shared string found in position 1 in the string table, corresponding to the value
"Seattle". Cell D3 contains an f element, indicating a formula.
0
2
Annex L
452.82
Examining the cell table entries for the data in row 4 of the spreadsheet, we see that cell B4 also
contains the string value "United States". This is the 2nd occurrence of the value "United States" in this
example. Since this value only occurs once in the string table, again the cell is using an index of 0 to
reference the string item in the string table. Cell C4 is of data type string and an index value of '2'
indicates that "Denver" is the value of this cell.
L.2.3.8 Example: Rich Text
In this example, a single string cell value has multiple types of text formatting applied to various parts of
the text.
L.2.3.9 Illustration
L.2.3.10 Shared String Table
The main difference between plain text and rich text is seen in the string table itself. The si element is
capable of containing rich text expressions:
This
string
ECMA-376 Part 1
has
a
variety
of
Annex L
formatting
applied
Reading the string from left to right as it appears in the cell, each word represents a change in
formatting. This change in formatting corresponds to separate run elements r to separate the text with
different formatting. Every word is expressed using a run element r, which expresses the properties of
the text rPr and the text itself t.
Since there are no properties associated with the first word "This", the text inherits the default
formatting for the cell.
The rich text expression for the second string "string" contains a bold faced font element indicator b in
the run properties rPr, therefore this text has bold face applied. While other text formatting properties
are expressed, they are the same as the cell formatting. This additional information is expressed for the
sake of clarity and completeness of expression.
The rich text expression for the third string "has" contains a color element indicator color in the run
properties rPr. Therefore, the color of the text associated with this set of run properties is red,
according to the color value expressed.
The formatting for the remaining words in this rich text string can be deduced in a similar manner, such
that "a" has default formatting applied, "variety" is both italicized and green, "of" has default formatting
applied, "formatting" is underlined, and "applied" has default formatting applied.
ECMA-376 Part 1
L.2.4 Tables
L.2.4.1 Overview
A table helps organize and provide structure to lists of information in a worksheet. Tables have clearly
labeled columns, rows, and data regions. Tables enable users to sort, analyze, format, manage, add, and
delete information. Here's an example of what a table can look like:
Notice that this table has column headings "State", "City", and "Zipcode". There is a row summarizing
the data, in this case a count of zip codes. The formatting helps make clear where the column headings
are (Bold faced, bordered on top and bottom all the way across), where the data region is (banded row
stripes), and where the totals row is (double border separating data from totals, bold face totals label).
Because the table feature has been applied to this data, special behaviors can be applied which help the
user perform useful actions. For example, if the user enters additional data in row 10, the table can
expand and automatically add that data to the data region of the table. Similarly, adding a column is as
easy as typing a new column heading to the right or left of the current column headings. Filter and sort
abilities are automatically surfaced to the user via the drop down arrows. Special calculated columns can
be created which summarize or calculate data in the table. These columns have the ability to expand
and shrink according to size of the table, and maintain proper formula referencing.
Tables can be made from data already present in the worksheet. Tables can also be the result of an
external data query. Finally, tables can be the result of mapping a collection of repeating XML elements
to a worksheet range.
L.2.4.2 File Architecture
Workbook
Sheet
Table
Annex L
Each table is referred to by a relationship from a sheet to the table. The relationship is found in the
sheet's _rels directory. The sheet XML also references the ID of this relationship, because there can be
more than one table in a sheet.
The sheet XML stores the numeric and textual data. The table XML records the various attributes for the
particular table object.
L.2.4.3 Example: Table
This example demonstrates a table created from data that was previously entered in the sheet. (See
§L.2.15 for a discussion of Tables with XML data bindings.)
L.2.4.4 Illustration
Consider the example provided in §L.2.4.1 above:
Notice that this table has column headings "State", "City", and "Zipcode". There is a row summarizing
the data, in this case a count of Zip codes. In the "State" column abbreviations of United States State
names are listed. In the City column are listed names of Cities within those states. Finally, within the
Zipcode column are postal codes residing within those cities.
The table has a style applied, which provides unique formatting for:
The column heading area, with bold facing and top and bottom borders
The data area, with banded striping
The total row area, with a top double border and bold facing
The last column area, with a solid background fill of blue.
ECMA-376 Part 1
L.2.4.5 The Sheet XML
The sheet XML for this example references the table definition part:
…
L.2.4.6 The Table XML
The tableParts collection appears after the sheetData section of the sheet. This sheet references a table
whose relationship Id r:id value is rId1.
The Table definition XML for this example:
name indicates that the Table's name is Table19, and the ref value indicates that it occupies the range
B3:D10 on the relevant sheet. totalsRowCount value of 1 indicates that this Table's total row is visible.
The autoFilter element indicates that the autoFilter feature is applied to the range B3:D10. The
tableColumns collection indicates there are 3 columns in the table, whose names are "State", "City",
and "Zipcode". Furthermore, the column titled "State" has a label in the total row, whose caption is
"Count", and the column titled "Zipcode" has a total row function applied, whose function is "count".
The tableStyleInfo element indicates various attributes of this Table's style and formatting. In this
example, name indicates that the Table style named "TableStyleMedium16" has been applied.
Additionally, even though formatting has been defined by this table style to indicate uniquely the first
column of the table, since showFirstColumn is set to 0 (false), this first column formatting is not
applied to the table. The same is true for column stripes. Since showColumnStripes is set to 0 (false),
even though formatting for column stripes is defined by the table style, it is not applied to this table.
Annex L
However, both row striping and last column formatting is set to be applied to this table, as indicated by
showRowStripes and showLastColumn.
L.2.5 Calculation Chain
L.2.5.1 Overview
The Calculation Chain part specifies the order in which cells in the workbook were last calculated. It only
records information about cells containing formulas. It does not include any information about the
formula-dependency calculation tree. In other words, the Calculation Chain part does not indicate the
dependencies that formulas have on other cell values; it only indicates the order in which the cells were
last calculated.
Any particular calculation event can cause the calculation chain order to be rearranged or altered. For
example, adding more formulas to the workbook adds references in the Calculation Chain part.
Another example of how the calculation order can be updated involves the idea of partial calculation.
Partial calculation is an optimization a spreadsheet application can implement to calculate only those
cells that are dependent on other cells whose values have changed, and to ignore other formulas in the
workbook. This helps to avoid redundantly recalculating results that are already known. Therefore, if a
set of formulas that were previously ignored during a calculation become required for calculation (due
to a cell's value changing), then these formulas move to "first" on the calculation chain so they can be
evaluated.
While calculation chain information can be loaded by a spreadsheet application, it is not required. A
calculation chain can be constructed in memory at load-time based on the formulas and their
interdependence, if the spreadsheet application finds this information useful. The order expressed in
the Calculation Chain part does not force or dictate to the implementing application the order in which
calculations must be performed at runtime.
L.2.5.2 Example
Consider the following set of formulas in a workbook:
ECMA-376 Part 1
Note that the content of each cell is displayed on the left side of the cell, and the evaluated value is
superimposed on the right side of each cell.
Cell A1 contains the numeric constant 1. Cell A2 contains the formula =A1+1, and this formula is filled
down to A10. Cell B1 contains the numeric constant 11. Cell B2 contains the formula =B1+1, and this
formula is filled down to B10. C10 contains the formula =B10+A10, whose current value is 30. D10
contains the formula =C10+10, whose current value is 40.
Because dependencies among formulas do affect calculation order, dependencies are discussed briefly
here. The formula in D10 depends on the result from C10. The formula in C10 depends on the results
from both A10 and B10. The formulas in column A each depend on the cell above them, ultimately
depending on the constant value in A1. The formulas in column B each depend on the cell above them,
ultimately depending on the constant value in B1.
This example was created by first entering the values in A1 then B1. Next, typing the formula in A2, and
filling that across to B2. Then the formulas in A2 and B2 were concurrently filled down to A10:B10.
Next, the formula was entered into C10, and finally the formula in D10 was entered. The application was
in automatic/partial calculation mode when this information was entered.
L.2.5.2.1 Partial Calculation
The calculation chain might be saved after initially entering the data and saving the workbook, as
follows:
Annex L
Every c element represents a cell containing a formula. The first cell calculated appears first (top-to-
bottom), and so on. The reference attribute r indicates the cell's address in the sheet. The index
attribute i indicates the index of the sheet with which that cell is associated. The sub-chain attribute s
(not present in this first example) indicates that this cell can be treated as a sub chain of the preceding
cell. Sub-chains can be useful when calculation can be multi-threaded or calculated concurrently.
Whenever a cell does not contain an i or s attribute, it is understood to inherit these values from the
previous cell.
Because of the way in which the workbook was initially created and saved, cell D10 should be the first
cell calculated. The reason for this, which cannot be determined from examining the XML, is that
cell D10 is the only cell that needs calculating, due to the partial calculation optimization. Since the
cells A2:B10 and C10 were previously calculated (as a result of entering formulas in those cells), when
entering the formula in D10, D10 is the only cell that needs to be calculated.
This calculation chain indicates that after D10 is calculated, C10 can be evaluated. In looking at the
dependencies, it is understood that during a full calculation, C10 would be evaluated before D10 can be
evaluated. However, because of the partial calculation optimization, at the time C10 was entered, it was
placed first on the calculation chain to be evaluated. Subsequent to that, D10 was entered, and so C10
was moved to second position in the calculation chain, and that is why it is currently in the second place.
Moving through the rest of the cells with this same logic, just before C10 was entered, A3, then B3,
then A4, then B4, and so on up to A10 and B10 were added and then evaluated as part of the fill-down
operation.
ECMA-376 Part 1
Finally, cells A2 and B2 were the first formulas to be added and calculated. All formulas in the workbook
were added after A2 and B2 were evaluated. Since A2 and B2 didn't need to be re-evaluated (due to the
partial calculation optimization) after that, they eventually settled to the end of the calculation chain.
L.2.5.2.2 First Full Calculation
Below is how the calculation chain looks after changing the values of A1 and B1, or after forcing the
application to perform a full calculation on the entire set of formulas:
Now the order of calculation seems more in line with the way in which the formulas depend on each
other: cells B2:B10 are calculated in order, and cells A2:A10 are calculated in order.
Additionally, the application has discovered that the formulas in column B can be calculated in parallel
with the formulas in column A (i.e., they don't depend on each other). This is evidenced by the presence
of s="1" on the cell element for cells B2:B10, indicating that B2:10 are part of a "child-chain" starting
with B2. Note also that C10 and B10 are included in that child chain, even though these formulas do, in
fact, depend on calculated values from column A. This is due to the multi-threaded nature of the
calculation engine. Currently the chain on which C10 and D10 reside can be calculated concurrently with
the chain on which A2:A10 reside because by the time C10 and D10 need to be calculated (e.g., by
CPU #1), A10 has already been calculated (e.g., by CPU #2). In some future calculation, the timing might
be different, and at that time, the application needs to resort to moving C10 and D10 to a new
calculation level (see §L.2.5.2.3).
Annex L
L.2.5.2.3 Twentieth 20th Full Calculation
After several full calculation iterations, this particular calculation chain settles into a stable state. For
example:
The difference introduced here is the concept of a dependency-level attribute l. This flag indicates that
all chain and child chain concurrent calculation must be completed (and all cells have newly calculated
values) before proceeding with calculation.
In this example, cells C10 and D10 are marked to exist in a new and separate dependency level from the
cells A2:A10 and B2:B10. This makes sense given how the dependencies for these formulas are set up:
A2:A10 can be calculated concurrently with B2:B10 because they do not depend on each other.
A2:A10 exists as one calculation chain, and B2:B10 exist as another parallel calculation chain.
However, C10 and D10 are both dependent on calculated results from the two parallel chains, and so
can only be calculated after the first set of parallel calculations are completed.
Dependency-Level l flags indicate where calculation must wait for all concurrent threads to complete
before continuing with calculation
ECMA-376 Part 1
L.2.6 Comments
L.2.6.1 Overview
A comment is a rich text note that is attached to, and associated with, a cell, separate from other cell
content. Comment content is stored separate from the cell, and is displayed in a drawing object (like a
text box) that is separate from, but associated with, a cell. Comments are used as reminders, such as
noting how a complex formula works, or to provide feedback to other users. Comments can also be used
to explain assumptions made in a formula or to call out something special about the cell.
L.2.6.2 Example
Consider the following graphic representation of a worksheet:
Note that cells D4 and J4 have comments.
L.2.6.3 File Architecture
Inside the file, the comment content ("Comments1") is expressed separately from the sheet information
("Sheet1"), and separately from the drawing information ("legacyDrawing1") for the containing object:
Sheet1
Comments1 legacyDrawing1
(drawingML)
The parts are related using relationships from the sheet to the comments and drawings parts.
Comments are stored together at the sheet-level. Therefore, if there are five worksheets in a workbook,
and three of those contain cells with associated comments, then there are three comment parts in the
file, one for each sheet.
Annex L
L.2.6.4 The XML
Chad
CBR
Chad:
Why such high expense?
ECMA-376 Part 1
CBR:
Pending a couple expenses in December.
L.2.6.5 Authors
Chad
CBR
The authors collection is a unique list of author names for all comments on a particular sheet. In this
example, there are two authors listed. Each comment definition references the authors collection by
zero-based index.
Annex L
L.2.6.6 Comments
Chad:
Why such high expense?
commentList is a listing of all comments on a sheet. The first comment in this example has ref="D4"
and authorId="0". This indicates that the comment is associated with cell D4 and is associated with the
author "Chad".
The content of comment is rich text, following the rich text schematics, including the author name and
actual comment.
L.2.7 Styles
L.2.7.1 Overview
There are several ways to express formatting applied to objects in a worksheet. SpreadsheetML
supports the concepts of Styles, Themes, and Direct Formatting applied to cell ranges, Tables,
PivotTables, Charts, and Shapes.
ECMA-376 Part 1
A Style is a named collection of formatting elements. A cell style can specify number format, cell
alignment, font information, cell border specifications, colors, and background / foreground fills. Table
styles specify formatting elements for the regions of a table (e.g. make the header row & totals bold
face, and apply light gray fill to alternating rows in the data portion of the table to achieve striped or
banded rows). PivotTable styles specify formatting elements for the regions of a PivotTable (e.g. 1st &
2nd level subtotals, row axis, column axis, and page fields).
A Style can specify color, fonts, and shape effects directly, or these elements can be referenced
indirectly by referring to a Theme definition. Using styles allows for quicker application of formatting and
more consistently stylized documents.
Themes define a set of colors, font information, and effects on shapes (including Charts). If a style or
formatting element defines its color, font, or effect by referencing a theme, then picking a new theme
switches all the colors, fonts, and effects for that formatting element.
Applying Direct Formatting means that particular elements of formatting (e.g. a bold font face or a
number format) have been applied, but the elements of formatting have been chosen individually
instead of collectively by choosing a named Style. Note that when applying direct formatting, themes
can still be referenced, causing those elements to change as the theme is changed.
L.2.7.2 File Architecture
Workbook
Sheet1 Styles Themes
For a workbook, a single Styles part holds all its formatting definitions. Similarly, a single Themes part
defines the theme information used in the workbook. These parts are referenced by relationship from
the Workbook part. Each of the formatted objects refers by index to a master formatting definition
record expressed in the Styles part. This master formatting record references additional supporting
formatting element collections in the Styles part. If the formatting element in the Styles part is defined
in terms of a theme, then this formatting element references an index to a theme element defined in
the Theme part. The solid arrows denote that there are relationships expressed from the Workbook part
to each of the Sheet1, Styles, and Themes parts. The dotted arrow from the Sheet1 part to the Styles
part indicates that there are references in the Sheet1 part's markup that refer, by index, to elements
defined in the markup in the Styles part. Similarly, the dotted arrow from the Styles part to the Themes
Annex L
part indicates that there are references in the Styles part's markup that refer, by index, to elements
defined in the markup in the Themes part.
L.2.7.3 Organization in the Styles Part
The Styles part is organized into element collections as described in the following subclauses. The
element collections must appear in the order presented below. The element collections are siblings in
the Styles part XML definition, whose parent, the root node of this part, is .
Please refer to the reference material or schemas themselves for more precise descriptions on the
required order of elements.
L.2.7.3.1 Number Format Expressions
This is where cell number formats used in this workbook are expressed. This collection never references
a theme. In this collection the numFmtId attribute is an actual ID, unlike the other sibling collections.
That is, instead of relying on the order in which a particular numFmt appears, it is referenced elsewhere
by calling out the numFmtId value. Then the corresponding numFmt record can be found by finding the
numFmt record with the matching numFmtId value. In the case of number formats, a set of numFmtId
values are predefined and fixed by ECMA-376. These values map to actual number formatting
expressions.
The following XML would format a cell containing the value 1234 to look like this:
A definition is referenced by ID (numFmtId) from either a or a .
To read more about how to interpret number format codes like the value found in formatCode above,
please read the reference section on numFmt, in the Styles section.
L.2.7.3.2 Font Definitions
This is where font definitions used in this workbook are expressed. Elements of the font definition can
reference theme definitions.
ECMA-376 Part 1
This font definition specifies bold face, font size of "11", a font color specified in the Theme part,
specifically the color whose index is "1" in the collection, a font name of "Calibri", and
whose font family value is "2" (for more explanation on font family, please refer to the Styles reference
material). A definition is referenced by index (fontId) from either a or a
.
A font record is referenced by zero-based index, meaning the numerical order in which the font
appears under fonts.
L.2.7.3.3 Fill Definitions
This is where fills used in the workbook are expressed.
This fill definition specifies a solid pattern fill, whose color uses a themed color, whose index is "4" in the
collection of the Theme part. A definition is referenced by index (fillId) from
either a or a .
A fill record is referenced by zero-based index, meaning the numerical order in which the fill
appears under fills.
L.2.7.3.4 Borders Definitions
This is where border formats are specified.
Annex L
This example specifies a cell with left, right, top, and bottom borders. A definition is
referenced by index (borderId) from either a or a .
A border record is referenced by zero-based index, meaning the numerical order in which the border
appears under borders.
L.2.7.3.5 Master Records - Cell Styles
The 'master' cell style record () ties together all the formatting (e.g. number format, font
information, and fill) for a named cell style. An inside is referenced by zero-
based index (not ID) (xfId) from a definition, which names a particular cell style.
L.2.7.3.6 Master Records - Formatting
The 'master' cell style record () ties together all the formatting (e.g. number format, font
information, and fill) for a cell's direct formatting. An inside is referenced by zero-
based index (not ID) (s) from a cell definition () in one of the sheets.
L.2.7.3.7 Cell Styles
This is a collection of cell styles used in the workbook.
L.2.7.3.8 Differential Formatting Records
"Differential formatting" enables subsets of formatting to be specified, without overriding other
elements of formatting. For example, if it is desired to express "add bold face to whatever formatting is
already there", then a definition can be used. definitions are used to express additional
(or "differential") formatting that is applied via Table styles or PivotTable styles. definitions are
referenced by index (dxfId) from a . The formatting elements used in a
definition are subsets of formatting collections described above.
A dxf record is referenced by zero-based index, meaning the numerical order in which the dxf appears
under dxfs.
ECMA-376 Part 1
L.2.7.3.9 Custom Table Style Definitions
Built-in Table and PivotTable styles are not saved out, only custom-defined styles are saved out. In this
example, a custom table style defines formatting for an element of a table, the "whole table" region.
L.2.7.4 Example
L.2.7.4.1 Illustration
For this example, consider this graphic representation of a worksheet:
Annex L
Looking at the top left region of the illustration, cells D2, F2, H2, J2, and B3:B4 have the cell style
"Accent1" applied to them. "Accent1" is a theme-driven style, and results in a blue cell fill and white /
Calibri font formatting. Additionally these cells have direct border formatting applied which isn't
specified as part of the "Accent1" cell style.
Cells D3:D4, F3:F4, H3:H4, and J3:J4 have a light blue cell fill applied. The light blue color is part of a
themed color scheme, and updates when a new theme is selected.
Cells D5, F5, H5, and J5 have a currency number format applied as well as a green cell fill. While the cell
fill is a themed color, the number format is fixed and does not vary or change if a new theme is selected.
The table in L2:O6 has a table style applied, called "TableStyleMedium10", which specifies formatting for
the header row, row striping, and total row (even though the total row isn't shown in this example).
The PivotTable in L9:N17 has a PivotTable style applied, called "PivotStyleMedium10", which specifies
formatting for the regions of a PivotTable, including the page field area in L9:M9, the header row area in
L11:N12, the totals row in L17:N17, and the body of data in L13:N16.
ECMA-376 Part 1
L.2.7.4.2 File Architecture
Workbook
Sheet1 Styles Themes
Table1 PivotTable1
All of the cells illustrated are defined in the "Sheet1" part in this example. The table is defined in the
"Table1" part and the PivotTable is defined in the part named "PivotTable1". Each of the formatted
objects refers to a set of formatting definitions which are expressed in the "Styles" part. If the
formatting element is part of a themed set, the element references a theme element defined in the
"Themes" part. The solid arrows represent relationships among the parts, the dotted arrows represent
references by Id or index to various elements in the target part.
L.2.7.4.3 The XML For This Example
Annex L
ECMA-376 Part 1
Annex L
ECMA-376 Part 1
Annex L
ECMA-376 Part 1
L.2.7.4.4 Cell D2 Formatting
Annex L
Cell D2 contains the text "Q1" and is defined in the cell table of sheet1 as:
0
On this cell, the attribute value s="7" indicates that the 7th (zero-based) definition of
holds the formatting information for the cell. The 7th of is defined as:
The number formatting information cannot be found in a definition because it is a built-in
format; instead, it is implicitly understood to be the 0th built-in number format. Remembering that the
indexes to other element collections are also zero-based, the font information can be found in the 4th
definition; the fill information in the 2nd definition; and the border information in the
2nd definition. The cell uses a cell style which is defined in the 1st
definition and, finally, borders specified in this master formatting record should be applied.
Remember that these collections are zero-based.
Additionally the |