A field is an element inside a paragraph whose text is worked out by the program: the page number, today’s date, a variable, a cross-reference. The element’s content is the value as it was last shown, so a reader that does not calculate fields can still show it; the value itself is kept in an attribute. Indexes, such as a table of contents, are generated from marks in the text and stored with their last result. This page covers chapters 7 and 8 of OpenDocument 1.3 part 3.
Common attributes
| Attribute | Meaning |
|---|---|
text:fixed | true: keep the value as it is; false: update it. |
style:data-style-name | A number: data style for showing a number, date or time. |
style:num-format, style:num-letter-sync | Number format of a count or page number (1, a, A, i, I and others), and whether letters repeat (aa, bb) or count on (aa, ab). |
text:formula | A formula: a namespace prefix, a colon and the formula text, such as ooow:A+1 or of:=[.A1]+1; the namespace says which syntax. |
office:value-type | Type of a value: float, percentage, currency, date, time, boolean, string or void. |
office:value, office:currency, office:date-value, office:time-value, office:boolean-value, office:string-value | The value, in the attribute for its type: a number (with a currency code for currency), an ISO date or date-time, an ISO duration such as PT03H30M00S, true/false, or text. A string with no office:string-value is the element’s content. |
text:display | On variable fields: value, formula (show the formula), or none (hide). |
Document fields
| Element | Shows | Attributes |
|---|---|---|
text:date | A date, by default today’s. | text:date-value, text:date-adjust (a duration added, or subtracted if negative), text:fixed, style:data-style-name |
text:time | A time, by default now. | text:time-value, text:time-adjust, text:fixed, style:data-style-name |
text:page-number | The page number. | text:select-page (previous, current, next), text:page-adjust (added to the number; nothing is shown if that page does not exist), text:fixed, style:num-format, style:num-letter-sync |
text:page-continuation | A notice that the text continues, shown only if the previous or next page exists. | text:select-page (previous or next), text:string-value |
text:author-name | The author’s full name. | text:fixed |
text:author-initials | The author’s initials. | text:fixed |
text:sender-firstname, -lastname, -initials, -title, -position, -email, -phone-private, -phone-work, -fax, -company, -street, -city, -postal-code, -state-or-province, -country | The sender’s (a later author’s) details. Updated on each edit unless fixed. | text:fixed |
text:chapter | The current chapter’s name or number; in a header or footer, on each page. | text:display (name, number, number-and-name, plain-number, plain-number-and-name; “plain” leaves out the prefix and suffix of the outline style), text:outline-level |
text:file-name | The document’s file name. | text:display (full, path, name, name-and-extension), text:fixed |
text:template-name | About the template. | text:display (full, path, name, name-and-extension, area (its category), title) |
text:sheet-name | The current sheet’s name. | – |
Variables, sequences and input fields
Variables must be declared before use. Simple variables can change value through the document; user variables have one value everywhere; sequence variables number things such as figures and start at 0.
| Element | Meaning | Attributes |
|---|---|---|
text:variable-decls | Holds text:variable-decl. | – |
text:variable-decl | Declares a simple variable. | text:name, office:value-type |
text:variable-set | Sets a simple variable from a formula, and shows it. | text:name, text:formula, text:display, value and type attributes, style:data-style-name |
text:variable-get | Shows the value from the last text:variable-set of that name before it (undefined if none). | text:name, text:display, style:data-style-name |
text:variable-input | Asks the user for a variable’s value. Empty if text:display is none. | text:name, text:description (the prompt), office:value-type, text:display, style:data-style-name |
text:user-field-decls | Holds text:user-field-decl. | – |
text:user-field-decl | Declares a user variable and its value. | text:name, text:formula, value and type attributes |
text:user-field-get | Shows a user variable. | text:name, text:display, style:data-style-name |
text:user-field-input | Asks for a user variable’s value. | text:name, text:description, style:data-style-name |
text:sequence-decls | Holds text:sequence-decl. | – |
text:sequence-decl | Declares a sequence, such as Illustration or Table. | text:name, text:display-outline-level (put the chapter number up to this level in front, 0 for none), text:separation-character (between chapter and number) |
text:sequence | Changes a sequence by its formula (usually +1) and shows it. | text:name, text:formula, text:ref-name (for references to it), style:num-format, style:num-letter-sync |
text:expression | Shows the result of a formula. | text:formula, text:display, value and type attributes, style:data-style-name |
text:text-input | A text input field; its content is what the user typed. | text:description |
text:drop-down | A drop-down list field; its content is the chosen item. | text:name; contains text:label |
text:label | One item of a drop-down list. | text:value, text:current-selected |
text:page-variable-set | Starts an alternative page numbering from this page (one active setter per page). | text:active, text:page-adjust |
text:page-variable-get | Shows that alternative page number; nothing if the setter is not active. | style:num-format, style:num-letter-sync |
<text:p><text:sequence text:name="Illustration" text:formula="ooow:Illustration+1"
style:num-format="1" text:ref-name="refIllustration0">1</text:sequence>: A diagram</text:p>
Metadata and statistics fields
These show values from meta.xml.
All take text:fixed; dates and times also take
style:data-style-name and a stored text:date-value or
text:time-value.
| Element | Shows |
|---|---|
text:initial-creator | meta:initial-creator |
text:creator | dc:creator |
text:creation-date | The date of meta:creation-date |
text:creation-time | The time the document was created |
text:modification-date | The date of dc:date |
text:modification-time | The time part of dc:date |
text:print-date | meta:print-date |
text:print-time | The time last printed |
text:printed-by | meta:printed-by |
text:title | dc:title |
text:subject | dc:subject |
text:description | dc:description |
text:keywords | The meta:keyword values, in an implementation’s own list format |
text:editing-cycles | meta:editing-cycles |
text:editing-duration | meta:editing-duration (stored in text:duration) |
text:user-defined | A meta:user-defined value, by text:name, with value attributes |
text:page-count | meta:page-count |
text:paragraph-count | meta:paragraph-count |
text:word-count | meta:word-count (how words are counted is up to the program) |
text:character-count | meta:character-count |
text:table-count | meta:table-count |
text:image-count | meta:image-count |
text:object-count | meta:object-count |
text:meta-field | Content generated from an RDF metadata source (any paragraph content); attributes xml:id, style:data-style-name |
The statistics fields take style:num-format and
style:num-letter-sync instead of text:fixed.
Database fields
These show data from a database table, query or SQL command, one row at a time (the
current row of the current selection). The data source is named by
text:database-name or a form:connection-resource child with
an xlink:href, plus text:table-name and
text:table-type (table, query or
command).
| Element | Meaning | Other attributes |
|---|---|---|
text:database-display | A column of the current row. | text:column-name, style:data-style-name |
text:database-next | Move to the next row (if the condition holds). | text:condition |
text:database-row-select | Move to a given row of the selection (if the condition holds). | text:condition, text:row-number |
text:database-row-number | The current row’s number in the database. | text:value, style:num-format, style:num-letter-sync |
text:database-name | The database and table of the last table used. | – |
form:connection-resource | The database, by IRI. | xlink:href |
References and other fields
| Element | Meaning | Attributes |
|---|---|---|
text:reference-ref | Refers to a reference mark. | text:ref-name, text:reference-format |
text:bookmark-ref | Refers to a bookmark. | text:ref-name, text:reference-format |
text:note-ref | Refers to a footnote or endnote. | text:ref-name, text:note-class, text:reference-format |
text:sequence-ref | Refers to a sequence field. | text:ref-name, text:reference-format |
text:conditional-text | Shows one string or another depending on a condition. | text:condition, text:string-value-if-true, text:string-value-if-false, text:current-value |
text:hidden-text | Text hidden when the condition is true. | text:condition, text:string-value, text:is-hidden |
text:hidden-paragraph | Hides the whole paragraph when the condition is true (unless another one in it is false). | text:condition, text:is-hidden |
text:placeholder | A placeholder to be replaced; its description is shown as an obvious placeholder. | text:placeholder-type (text, table, text-box, image, object), text:description |
text:script | A script, as content or as a link (not both). | script:language, xlink:href, xlink:type |
text:execute-macro | Runs a macro when activated; the content describes it. | text:name; contains office:event-listeners |
text:dde-connection | Data from a DDE connection; the content is the last data received. | text:connection-name |
text:measure | Part of the text of a dimension line shape. | text:kind (value, unit, gap) |
text:table-formula | Deprecated: a formula in a table. | text:formula, text:display, style:data-style-name |
text:reference-format (default page):
| Value | Shows | Allowed on |
|---|---|---|
page | Page number of the target | All |
chapter | Chapter number of the target | All |
direction | Whether the target is above or below | All |
text | The target’s text | All |
number | The target’s list label, with as many higher levels as needed | Reference and bookmark references |
number-all-superior | The list label with all higher levels in front | Reference and bookmark references |
number-no-superior | The list label alone | Reference and bookmark references |
category-and-value | Sequence name and number, such as “Figure 3” | Sequence references |
caption | The caption the sequence is in | Sequence references |
value | The sequence number | Sequence references |
Index marks
Marks in the text say what goes into a table of contents, a user index, an
alphabetical index or a bibliography. A mark is either a point element, whose entry
text is an attribute, or a start and end pair in the same paragraph, matched by
text:id, whose entry text is the text between them; the attributes go on
the start. Marks may overlap.
| Element | Attributes |
|---|---|
text:toc-mark | text:string-value, text:outline-level |
text:toc-mark-start, text:toc-mark-end | text:id; start also text:outline-level |
text:user-index-mark | text:string-value, text:index-name, text:outline-level |
text:user-index-mark-start, -end | text:id; start also text:index-name, text:outline-level |
text:alphabetical-index-mark | text:string-value, text:string-value-phonetic, text:key1, text:key2 (higher-level headings), text:key1-phonetic, text:key2-phonetic, text:main-entry |
text:alphabetical-index-mark-start, -end | text:id; start also the keys, phonetic values and text:main-entry |
text:bibliography-mark | text:identifier, text:bibliography-type, and one attribute per field: text:address, annote, author, booktitle, chapter, custom1–custom5, edition, editor, howpublished, institution, isbn, issn, journal, month, note, number, organizations, pages, publisher, report-type, school, series, title, url, volume, year |
text:bibliography-type is one of article,
book, booklet, conference, custom1
to custom5, email, inbook,
incollection, inproceedings, journal,
manual, mastersthesis, misc,
phdthesis, proceedings, techreport,
unpublished or www, after BibTeX.
Indexes
Each index element has a source element, which says how to build it, and a
text:index-body with the last generated result (often starting with a
text:index-title). All index elements take text:name,
text:style-name (a section style), text:protected,
text:protection-key, text:protection-key-digest-algorithm and
xml:id. Sources take text:index-scope
(document, the default, or chapter) and
text:relative-tab-stop-position.
| Index | Source and its attributes | Entry template |
|---|---|---|
text:table-of-content: headings, contents marks and paragraphs in chosen styles | text:table-of-content-source: text:outline-level, text:use-outline-level, text:use-index-marks, text:use-index-source-styles | text:table-of-content-entry-template, one per level (text:outline-level) |
text:illustration-index: images and graphics | text:illustration-index-source: text:use-caption, text:caption-sequence-name, text:caption-sequence-format | text:illustration-index-entry-template |
text:table-index: tables | text:table-index-source: the same caption attributes | text:table-index-entry-template |
text:object-index: embedded objects | text:object-index-source: text:use-chart-objects, text:use-draw-objects, text:use-math-objects, text:use-spreadsheet-objects, text:use-other-objects | text:object-index-entry-template |
text:user-index: user index marks, styled paragraphs, tables, graphics, objects, frames | text:user-index-source: text:index-name, text:copy-outline-levels, text:use-index-marks, text:use-index-source-styles, text:use-tables, text:use-graphics, text:use-objects, text:use-floating-frames | text:user-index-entry-template (text:outline-level) |
text:alphabetical-index: alphabetical marks, sorted | text:alphabetical-index-source: text:ignore-case, text:main-entry-style-name, text:alphabetical-separators, text:combine-entries, text:combine-entries-with-dash, text:combine-entries-with-pp, text:use-keys-as-entries, text:capitalize-entries, text:comma-separated, text:sort-algorithm, fo:language, fo:country, fo:script, style:rfc-language-tag | text:alphabetical-index-entry-template (text:outline-level: 1, 2, 3 or separator) |
text:bibliography: bibliography marks | text:bibliography-source | text:bibliography-entry-template, at most one per text:bibliography-type |
Sources may also contain text:index-title-template (the title’s style
and text) and text:index-source-styles (one per outline level, holding
text:index-source-style elements naming paragraph styles to include). An
alphabetical index can use text:alphabetical-index-auto-mark-file, a file
of terms to mark automatically, in a format of the program’s own.
Entry template parts
| Element | Meaning | Attributes |
|---|---|---|
text:index-entry-text | The entry’s text. | text:style-name |
text:index-entry-page-number | The page number. | text:style-name |
text:index-entry-chapter | The chapter number or name. | text:display, text:outline-level, text:style-name |
text:index-entry-span | Fixed text. | text:style-name |
text:index-entry-tab-stop | A tab stop. | style:type, style:position, style:leader-char, text:style-name |
text:index-entry-link-start, text:index-entry-link-end | Start and end of a hyperlink to the entry’s target. | text:style-name |
text:index-entry-bibliography | One field of a bibliography entry. | text:bibliography-data-field, text:style-name |
<text:table-of-content text:name="Table of Contents1" text:style-name="Sect1">
<text:table-of-content-source text:outline-level="3">
<text:index-title-template text:style-name="Contents_20_Heading">Contents</text:index-title-template>
<text:table-of-content-entry-template text:outline-level="1" text:style-name="Contents_20_1">
<text:index-entry-link-start/><text:index-entry-chapter/><text:index-entry-text/>
<text:index-entry-tab-stop style:type="right" style:leader-char="."/>
<text:index-entry-page-number/><text:index-entry-link-end/>
</text:table-of-content-entry-template>
</text:table-of-content-source>
<text:index-body>
<text:index-title text:name="Table of Contents1_Head"><text:p>Contents</text:p></text:index-title>
<text:p text:style-name="Contents_20_1">Introduction<text:tab/>1</text:p>
</text:index-body>
</text:table-of-content>