Original PDF Flash format oasis-open-office-specification  


Oasis Open Office Specification

Open Document Format for Office
Applications (OpenDocument) v1.0

OASIS Standard, 1 May 2005
Document identifier:
OpenDocument-v1.0-os.sxw
Location:
http://docs.oasis-open.org/office/v1.0
Editors:
Michael Brauer, Sun Microsystems <michael.brauer@sun.com>
Patrick Durusau, Society of Biblical Literature <Patrick.Durusau@sbl-site.org>
Gary Edwards <garyedwards@yahoo.com>
David Faure, <faure@kde.org>
Tom Magliery, Blast Radius <tom.magliery@blastradius.com>
Daniel Vogelheim, Sun Microsystems <daniel.vogelheim@sun.com>
Contributors:
Doug Alberg, Boeing <doug.alberg@boeing.com>
Simon Davis, National Archive of Australia <simond@naa.gov.au>
Paul Grosso, Arbortext <paul@arbortext.com>
Phil Boutros, Stellent <pboutros@stellent.com>
John Chelsom, CSW Informatics <john.chelsom@csw.co.uk>
Jason Harrop <jharrop@speedlegal.com>
Mark Heller, New York State Office of the Attorney General
<Mark.Heller@oag.state.ny.us>
Paul Langille, Corel <paul.langille@corel.com>
Monica Martin, Drake Certivo <mmartin@certivo.net>
Uche Ogbuji <uche.ogbuji@fourthought.com>
Lars Oppermann, Sun Microsystems <lars.oppermann@sun.com>
Lauren Wood <lauren@textuality.com>
Abstract:
This is the specification of the Open Document Format for Office Applications
(OpenDocument) format, an open, XML-based file format for office applications, based
on OpenOffice.org XML [OOo].
Status:
This document was last revised or approved by the membership of OASIS on the above
date. The level of approval is also listed above.
Check the current location noted above for possible later revisions of this document.
This document is updated periodical y on no particular schedule.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 1 of 706

Technical Committee members should send comments on this specification to the
Technical Committee's email list. Others should send comments to the Technical
Committee by using the "Send A Comment" button on the Technical Committee's web
page at
www.oasis-open.org/committees/office.
For information on whether any patents have been disclosed that may be essential to
implementing this specification, and any offers of patent licensing terms, please refer to
the Intellectual Property Rights section of the Technical Committee web page
(www.oasis-open.org/committees/office/ipr.php.
The non-normative errata page for this specification is located at www.oasis-
open.org/committees/office.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 2 of 706

Table of Contents
1 Introduction..................................................................................................................................31
1.1 Introduction...........................................................................................................................31
1.2 Notation.................................................................................................................................31
1.3 Namespaces.........................................................................................................................31
1.4 Relax-NG Schema...............................................................................................................33
1.5 Document Processing and Conformance............................................................................34
1.6 White-Space Processing and EOL Handling.......................................................................35
1.7 MIME Types and File Name Extensions..............................................................................35
2 Document Structure.....................................................................................................................37
2.1 Document Roots...................................................................................................................37
2.1.1 Document Root Element Content Models....................................................................38
2.1.2 Document Root Attributes.............................................................................................39
2.2 Document Metadata.............................................................................................................40
2.2.1 Pre-Defined vs. Custom Metadata............................................................................... 40
2.2.2 Sample Metadata..........................................................................................................41
2.3 Body Element and Document Types....................................................................................41
2.3.1 Text Documents............................................................................................................42
2.3.2 Drawing Documents......................................................................................................43
2.3.3 Presentation Documents...............................................................................................44
2.3.4 Spreadsheet Documents...............................................................................................45
2.3.5 Chart Documents..........................................................................................................46
2.3.6 Image Documents.........................................................................................................46
2.4 Application Settings..............................................................................................................47
2.4.1 Sequence of Settings....................................................................................................47
2.4.2 Base Settings................................................................................................................48
2.4.3 Index Access of Sequences..........................................................................................49
2.4.4 Map Entry......................................................................................................................49
2.4.5 Name Access of Sequences.........................................................................................50
2.4.6 Cursor Position Setting.................................................................................................50
2.5 Scripts...................................................................................................................................50
2.5.1 Script.............................................................................................................................51
2.6 Font Face Declarations........................................................................................................51
2.7 Styles....................................................................................................................................52
2.7.1 Location of Styles .........................................................................................................52
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 3 of 706

2.8 Page Styles and Layout........................................................................................................55
3 Meta Data Elements....................................................................................................................56
3.1 Pre-Defined Metadata Elements..........................................................................................56
3.1.1 Generator......................................................................................................................56
3.1.2 Title................................................................................................................................56
3.1.3 Description....................................................................................................................56
3.1.4 Subject..........................................................................................................................57
3.1.5 Keywords.......................................................................................................................57
3.1.6 Initial Creator ................................................................................................................57
3.1.7 Creator...........................................................................................................................57
3.1.8 Printed By......................................................................................................................57
3.1.9 Creation Date and Time................................................................................................58
3.1.10 Modification Date and Time........................................................................................58
3.1.11 Print Date and Time....................................................................................................58
3.1.12 Document Template....................................................................................................58
3.1.13 Automatic Reload........................................................................................................59
3.1.14 Hyperlink Behavior......................................................................................................60
3.1.15 Language.....................................................................................................................61
3.1.16 Editing Cycles.............................................................................................................61
3.1.17 Editing Duration...........................................................................................................62
3.1.18 Document Statistics....................................................................................................62
3.2 User-defined Metadata.........................................................................................................64
3.3 Custom Metadata.................................................................................................................65
4 Text Content.................................................................................................................................66
4.1 Headings, Paragraphs and Basic Text Structure.................................................................66
4.1.1 Headings.......................................................................................................................66
4.1.2 Paragraphs....................................................................................................................67
4.1.3 Common Paragraph Elements Attributes.....................................................................67
4.2 Page Sequences...................................................................................................................68
4.2.1 Page..............................................................................................................................69
4.3 Lists.......................................................................................................................................70
4.3.1 List Block.......................................................................................................................70
4.3.2 List Item.........................................................................................................................71
4.3.3 List Header....................................................................................................................72
4.3.4 Numbered Paragraphs..................................................................................................73
4.4 Text Sections........................................................................................................................73
4.4.1 Section Attributes..........................................................................................................74
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 4 of 706

4.4.2 Section Source..............................................................................................................76
4.4.3 DDE Source..................................................................................................................77
4.5 Page-bound graphical content..............................................................................................77
4.6 Change Tracking..................................................................................................................77
4.6.1 Tracked Changes..........................................................................................................78
4.6.2 Changed Regions..........................................................................................................78
4.6.3 Insertion.........................................................................................................................78
4.6.4 Deletion.........................................................................................................................79
4.6.5 Format Change.............................................................................................................81
4.6.6 Change Info...................................................................................................................81
4.6.7 Change Marks...............................................................................................................81
4.7 Text Declarations..................................................................................................................82
5 Paragraph Elements Content.......................................................................................................84
5.1 Basic Text Content...............................................................................................................84
5.1.1 White-space Characters................................................................................................84
5.1.2 Soft Hyphens, Hyphens, and Non-breaking Blanks......................................................86
5.1.3 Attributed Text...............................................................................................................86
5.1.4 Hyperlinks......................................................................................................................87
5.2 Bookmarks and References.................................................................................................89
5.2.1 Bookmarks....................................................................................................................89
5.2.2 References....................................................................................................................90
5.3 Notes.....................................................................................................................................91
5.3.1 Note Element................................................................................................................91
5.4 Ruby......................................................................................................................................93
5.5 Text Annotation....................................................................................................................94
5.6 Index Marks..........................................................................................................................94
5.7 Change Tracking and Change Marks...................................................................................94
5.8 Inline graphics and text-boxes..............................................................................................94
6 Text Fields...................................................................................................................................95
6.1 Common Characteristics of Field Elements........................................................................ 95
6.2 Document Fields...................................................................................................................96
6.2.1 Date Fields....................................................................................................................96
6.2.2 Time Fields....................................................................................................................97
6.2.3 Page Number Fields.....................................................................................................99
6.2.4 Page Continuation Text..............................................................................................100
6.2.5 Sender Fields..............................................................................................................101
6.2.6 Author Fields...............................................................................................................104
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 5 of 706

6.2.7 Chapter Fields.............................................................................................................104
6.2.8 File Name Fields.........................................................................................................105
6.2.9 Document Template Name Fields..............................................................................106
6.2.10 Sheet Name Fields....................................................................................................107
6.3 Variable Fields....................................................................................................................107
6.3.1 Declaring Simple Variables.........................................................................................108
6.3.2 Setting Simple Variables.............................................................................................108
6.3.3 Displaying Simple Variables.......................................................................................109
6.3.4 Simple Variable Input Fields.......................................................................................110
6.3.5 Declaring User Variables............................................................................................111
6.3.6 Displaying User Variables...........................................................................................111
6.3.7 User Variable Input Fields...........................................................................................112
6.3.8 Declaring Sequence Variables....................................................................................113
6.3.9 Using Sequence Fields...............................................................................................114
6.3.10 Expression Fields......................................................................................................115
6.3.11 Text Input Fields.......................................................................................................116
6.4 Metadata Fields..................................................................................................................116
6.4.1 Initial Creator...............................................................................................................116
6.4.2 Document Creation Date............................................................................................117
6.4.3 Document Creation Time............................................................................................117
6.4.4 Document Description.................................................................................................117
6.4.5 User-Defined Document Information..........................................................................117
6.4.6 Print Time....................................................................................................................118
6.4.7 Print Date....................................................................................................................118
6.4.8 Printed By....................................................................................................................119
6.4.9 Document Title............................................................................................................119
6.4.10 Document Subject.....................................................................................................119
6.4.11 Document Keywords.................................................................................................119
6.4.12 Document Revision Number.....................................................................................119
6.4.13 Document Edit Duration............................................................................................120
6.4.14 Document Modification Time....................................................................................120
6.4.15 Document Modification Date.....................................................................................120
6.4.16 Document Modified By..............................................................................................121
6.4.17 Document Statistics Fields........................................................................................121
6.5 Database Fields..................................................................................................................121
6.5.1 Database Field Data Source.......................................................................................122
6.5.2 Displaying Database Content......................................................................................123
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 6 of 706

6.5.3 Selecting the Next Database Row..............................................................................124
6.5.4 Selecting a Row Number............................................................................................125
6.5.5 Displaying the Row Number........................................................................................126
6.5.6 Display Current Database and Table..........................................................................126
6.6 More Fields.........................................................................................................................127
6.6.1 Page Variable Fields...................................................................................................127
6.6.2 Placeholders................................................................................................................128
6.6.3 Conditional Text Fields...............................................................................................129
6.6.4 Hidden Text Field........................................................................................................130
6.6.5 Reference Fields.........................................................................................................131
6.6.6 Script Fields................................................................................................................134
6.6.7 Macro Fields................................................................................................................135
6.6.8 Hidden Paragraph Fields............................................................................................135
6.6.9 DDE Connection Fields...............................................................................................136
6.6.10 Measure Fields..........................................................................................................137
6.6.11 Table Formula Field..................................................................................................137
6.7 Common Field Attributes....................................................................................................138
6.7.1 Variable Value Types and Values...............................................................................138
6.7.2 Fixed............................................................................................................................140
6.7.3 Variable Name............................................................................................................140
6.7.4 Description .................................................................................................................141
6.7.5 Display.........................................................................................................................141
6.7.6 Formula.......................................................................................................................142
6.7.7 Formatting Style..........................................................................................................142
6.7.8 Number Formatting Style............................................................................................143
7 Text Indices................................................................................................................................144
7.1 Index Marks........................................................................................................................144
7.1.1 Table of Content Index Marks.....................................................................................144
7.1.2 User-Defined Index Marks..........................................................................................145
7.1.3 Alphabetical Index Mark..............................................................................................146
7.1.4 Bibliography Index Mark.............................................................................................148
7.2 Index Structure...................................................................................................................149
7.2.1 Index Source...............................................................................................................149
7.2.2 Index Body Section.....................................................................................................150
7.2.3 Index Title Section......................................................................................................150
7.3 Table Of Content................................................................................................................150
7.3.1 Table of Content Source.............................................................................................151
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 7 of 706

7.3.2 Table of Content Entry Template................................................................................153
7.4 Index of Illustrations...........................................................................................................154
7.4.1 Index of Illustration Source.........................................................................................155
7.4.2 Il ustration Index Entry Template................................................................................156
7.5 Index of Tables...................................................................................................................157
7.5.1 Table Index Source.....................................................................................................157
7.5.2 Table Index Entry Template........................................................................................157
7.6 Index of Objects..................................................................................................................158
7.6.1 Object Index Source...................................................................................................158
7.6.2 Object Index Entry Template......................................................................................159
7.7 User-Defined Index.............................................................................................................160
7.7.1 User-Defined Index Source.........................................................................................160
7.7.2 User-Defined Index Entry Template...........................................................................162
7.8 Alphabetical Index..............................................................................................................163
7.8.1 Alphabetical Index Source..........................................................................................163
7.8.2 Auto Mark File.............................................................................................................167
7.8.3 Alphabetical Index Entry Template.............................................................................167
7.9 Bibliography........................................................................................................................168
7.9.1 Bibliography Index Source..........................................................................................168
7.9.2 Bibliography Entry Template.......................................................................................168
7.10 index source styles...........................................................................................................169
7.10.1 Index source style.....................................................................................................169
7.11 Index title template...........................................................................................................170
7.12 Index Template Entries....................................................................................................170
7.12.1 Chapter Information..................................................................................................170
7.12.2 Entry Text..................................................................................................................171
7.12.3 Page Number............................................................................................................171
7.12.4 Fixed String...............................................................................................................171
7.12.5 Bibliography Information...........................................................................................172
7.12.6 Tab Stop....................................................................................................................173
7.12.7 Hyperlink Start and End............................................................................................174
7.12.8 Example of an Index Entry Configuration.................................................................174
8 Tables.........................................................................................................................................176
8.1 Basic Table Model..............................................................................................................176
8.1.1 Table Element.............................................................................................................176
8.1.2 Table Row ..................................................................................................................179
8.1.3 Table Cell ...................................................................................................................181
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 8 of 706

8.2 Advanced Table Model.......................................................................................................186
8.2.1 Column Description ....................................................................................................186
8.2.2 Header Columns.........................................................................................................188
8.2.3 Column Groups...........................................................................................................189
8.2.4 Header Rows...............................................................................................................189
8.2.5 Row Groups.................................................................................................................190
8.2.6 Subtables ....................................................................................................................190
8.3 Advanced Tables................................................................................................................193
8.3.1 Referencing Table Cells..............................................................................................193
8.3.2 Linked Tables..............................................................................................................195
8.3.3 Scenario Tables..........................................................................................................197
8.3.4 Shapes........................................................................................................................199
8.4 Advanced Table Cells .......................................................................................................200
8.4.1 Linked Table Cells.......................................................................................................200
8.4.2 Cell Annotation ...........................................................................................................201
8.4.3 Detective.....................................................................................................................201
8.4.4 Detective Operation....................................................................................................201
8.4.5 Highlighted Range.......................................................................................................202
8.5 Spreadsheet Document Content........................................................................................204
8.5.1 Document Protection..................................................................................................204
8.5.2 Calculation Settings....................................................................................................204
8.5.3 Table Cell Content Validations...................................................................................207
8.5.4 Label Ranges..............................................................................................................211
8.5.5 Named Expressions....................................................................................................212
8.6 Database Ranges...............................................................................................................214
8.6.1 Database Range .........................................................................................................215
8.6.2 Database Source SQL ...............................................................................................217
8.6.3 Database Source Table .............................................................................................218
8.6.4 Database Source Query..............................................................................................219
8.6.5 Sort .............................................................................................................................219
8.6.6 Sort By ........................................................................................................................221
8.6.7 Subtotal Rules ............................................................................................................222
8.6.8 Subtotal Sort Groups ..................................................................................................223
8.6.9 Subtotal Rule ..............................................................................................................224
8.6.10 Subtotal Field ...........................................................................................................224
8.7 Filters..................................................................................................................................225
8.7.1 Table Filter..................................................................................................................225
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 9 of 706

8.7.2 Filter And.....................................................................................................................227
8.7.3 Filter Or ......................................................................................................................227
8.7.4 Filter Condition ...........................................................................................................228
8.8 Data Pilot Tables................................................................................................................230
8.8.1 Data Pilot Table...........................................................................................................230
8.8.2 Source Cell Range......................................................................................................235
8.8.3 Source Service............................................................................................................235
8.8.4 Data Pilot Field............................................................................................................237
8.8.5 Data Pilot Level...........................................................................................................239
8.8.6 Data Pilot Subtotals.....................................................................................................240
8.8.7 Data Pilot Subtotal......................................................................................................240
8.8.8 Data Pilot Members.....................................................................................................241
8.8.9 Data Pilot Member......................................................................................................241
8.8.10 Data Pilot Display Info..............................................................................................242
8.8.11 Data Pilot Sort Info....................................................................................................243
8.8.12 Data Pilot Layout Info................................................................................................244
8.8.13 Data Pilot Field Reference........................................................................................245
8.8.14 Data Pilot Groups......................................................................................................246
8.8.15 Data Pilot Group........................................................................................................248
8.8.16 Data Pilot Group Member.........................................................................................249
8.9 Consolidation......................................................................................................................249
8.10 DDE Links.........................................................................................................................251
8.11 Change Tracking in Spreadsheets...................................................................................251
8.11.1 Tracked Changes......................................................................................................251
8.11.2 Insertion.....................................................................................................................252
8.11.3 Dependencies............................................................................................................253
8.11.4 Dependence..............................................................................................................254
8.11.5 Deletions....................................................................................................................254
8.11.6 Cell Content Deletion................................................................................................254
8.11.7 Change Deletion........................................................................................................254
8.11.8 Deletion.....................................................................................................................255
8.11.9 Cut Offs.....................................................................................................................256
8.11.10 Insertion Cut Off......................................................................................................257
8.11.11 Movement Cut Off..................................................................................................257
8.11.12 Movement...............................................................................................................258
8.11.13 Target Range Address, Source Range Address.....................................................259
8.11.14 Change Track Cell..................................................................................................260
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 10 of 706

8.11.15 Cell Content Change...............................................................................................261
8.11.16 Cell Address............................................................................................................262
8.11.17 Previous..................................................................................................................262
8.11.18 Common Change Tracking Attributes.................................................................... 262
9 Graphic Content.........................................................................................................................264
9.1 Enhanced Page Features for Graphical Applications........................................................264
9.1.1 Handout Master...........................................................................................................264
9.1.2 Layer Sets...................................................................................................................265
9.1.3 Layer............................................................................................................................266
9.1.4 Drawing Pages............................................................................................................266
9.1.5 Presentation Notes......................................................................................................269
9.2 Drawing Shapes..................................................................................................................270
9.2.1 Rectangle....................................................................................................................270
9.2.2 Line..............................................................................................................................271
9.2.3 Polyline........................................................................................................................272
9.2.4 Polygon........................................................................................................................273
9.2.5 Regular Polygon..........................................................................................................273
9.2.6 Path.............................................................................................................................275
9.2.7 Circle...........................................................................................................................276
9.2.8 Ellipse..........................................................................................................................277
9.2.9 Connector....................................................................................................................278
9.2.10 Caption......................................................................................................................281
9.2.11 Measure.....................................................................................................................282
9.2.12 Control.......................................................................................................................283
9.2.13 Page Thumbnail........................................................................................................284
9.2.14 Grouping....................................................................................................................285
9.2.15 Common Drawing Shape Attributes......................................................................... 285
9.2.16 Common Shape Attributes for Text and Spreadsheet Documents..........................289
9.2.17 Common Drawing Shape Content............................................................................291
9.2.18 Common Shape Attribute Groups.............................................................................291
9.2.19 Glue Points................................................................................................................292
9.2.20 Event Listeners.........................................................................................................293
9.3 Frames................................................................................................................................294
9.3.1 Text Box......................................................................................................................296
9.3.2 Image..........................................................................................................................298
9.3.3 Objects........................................................................................................................300
9.3.4 Applet..........................................................................................................................301
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 11 of 706

9.3.5 Plugins.........................................................................................................................303
9.3.6 Parameters..................................................................................................................304
9.3.7 Floating Frame............................................................................................................304
9.3.8 Contour........................................................................................................................305
9.3.9 Alternative Text...........................................................................................................306
9.3.10 Hyperlinks..................................................................................................................306
9.3.11 Client Side Image Maps............................................................................................308
9.4 3D Shapes..........................................................................................................................312
9.4.1 Scene..........................................................................................................................312
9.4.2 Light.............................................................................................................................316
9.4.3 Cube............................................................................................................................317
9.4.4 Sphere.........................................................................................................................317
9.4.5 Extrude........................................................................................................................318
9.4.6 Rotate..........................................................................................................................319
9.5 Custom Shape....................................................................................................................319
9.5.1 Enhanced Geometry...................................................................................................320
9.5.2 Enhanced Geometry - Extrusion Attributes................................................................323
9.5.3 Enhanced Geometry - Path Attributes........................................................................329
9.5.4 Enhanced Geometry - Text Path Attributes................................................................333
9.5.5 Enhanced Geometry – Equation.................................................................................334
9.5.6 Enhanced Geometry - Handle Attributes....................................................................336
9.6 Presentation Shapes..........................................................................................................340
9.6.1 Common Presentation Shape Attributes....................................................................340
9.7 Presentation Animations.....................................................................................................342
9.7.1 Sound..........................................................................................................................342
9.7.2 Show Shape................................................................................................................343
9.7.3 Show Text...................................................................................................................347
9.7.4 Hide Shape..................................................................................................................347
9.7.5 Hide Text.....................................................................................................................347
9.7.6 Dim..............................................................................................................................348
9.7.7 Play..............................................................................................................................348
9.7.8 Effect groups...............................................................................................................349
9.8 SMIL Presentation Animations...........................................................................................349
9.8.1 Recommended Usage Of SMIL..................................................................................349
9.8.2 Document Dependent SMIL Animation Attribute Values........................................... 350
9.8.3 SMIL Presentation Animation Attributes.....................................................................353
9.9 Presentation Events...........................................................................................................355
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 12 of 706

9.10 Presentation Text Fields...................................................................................................358
9.10.1 Header Field..............................................................................................................358
9.10.2 Footer Field...............................................................................................................358
9.10.3 Date and Time Field..................................................................................................359
9.11 Presentation Document Content......................................................................................359
9.11.1 Presentation Declarations.........................................................................................359
9.11.2 Header field declaration............................................................................................359
9.11.3 Footer field declaration.............................................................................................360
9.11.4 Date and Time field declaration................................................................................360
9.11.5 Presentation Settings................................................................................................361
9.11.6 Show Definitions.......................................................................................................365
10 Chart Content...........................................................................................................................366
10.1 Introduction to Chart Documents.....................................................................................366
10.2 Chart.................................................................................................................................366
10.3 Title, Subtitle and Footer..................................................................................................370
10.3.1 Title............................................................................................................................370
10.3.2 Subtitle......................................................................................................................371
10.3.3 Footer........................................................................................................................371
10.4 Legend..............................................................................................................................371
10.5 Plot Area...........................................................................................................................373
10.5.1 3D Plot Area..............................................................................................................375
10.6 Wall...................................................................................................................................375
10.7 Floor..................................................................................................................................376
10.8 Axis...................................................................................................................................376
10.8.1 Grid............................................................................................................................378
10.9 Series................................................................................................................................379
10.9.1 Domain......................................................................................................................380
10.10 Categories.......................................................................................................................381
10.11 Data Point.......................................................................................................................381
10.12 Mean Value.....................................................................................................................382
10.13 Error Indicator.................................................................................................................382
10.14 Regression Curves.........................................................................................................383
10.14.1 Stock Chart Markers...............................................................................................383
11 Form Content...........................................................................................................................385
11.1 Form.................................................................................................................................386
11.1.1 Action........................................................................................................................387
11.1.2 Target Frame............................................................................................................387
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 13 of 706

11.1.3 Method.......................................................................................................................388
11.1.4 Encoding Type..........................................................................................................388
11.1.5 Allow Deletes.............................................................................................................388
11.1.6 Allow Inserts..............................................................................................................389
11.1.7 Allow Updates...........................................................................................................389
11.1.8 Apply Filter................................................................................................................389
11.1.9 Command Type.........................................................................................................389
11.1.10 Command................................................................................................................390
11.1.11 Data Source............................................................................................................390
11.1.12 Master Fields...........................................................................................................390
11.1.13 Detail Fields............................................................................................................390
11.1.14 Escape Processing..................................................................................................391
11.1.15 Filter........................................................................................................................391
11.1.16 Ignore Result...........................................................................................................391
11.1.17 Navigation Mode.....................................................................................................392
11.1.18 Order.......................................................................................................................392
11.1.19 Tabbing Cycle.........................................................................................................392
11.1.20 Connection Resource..............................................................................................393
11.2 XForms Model..................................................................................................................393
11.2.1 XForms Model...........................................................................................................393
11.3 Controls.............................................................................................................................394
11.3.1 Text...........................................................................................................................394
11.3.2 Text Area...................................................................................................................395
11.3.3 Password...................................................................................................................396
11.3.4 File.............................................................................................................................397
11.3.5 Formatted Text..........................................................................................................397
11.3.6 Number......................................................................................................................398
11.3.7 Date And Time..........................................................................................................400
11.3.8 Fixed Text.................................................................................................................401
11.3.9 Combo Box................................................................................................................402
11.3.10 List Box....................................................................................................................403
11.3.11 Button......................................................................................................................405
11.3.12 Image......................................................................................................................406
11.3.13 Check Box...............................................................................................................407
11.3.14 Radio Button............................................................................................................408
11.3.15 Frame......................................................................................................................409
11.3.16 Image Frame...........................................................................................................409
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 14 of 706

11.3.17 Hidden.....................................................................................................................410
11.3.18 Grid..........................................................................................................................410
11.3.19 Value Range............................................................................................................412
11.3.20 Generic Control.......................................................................................................414
11.4 Common Form and Control Attributes.............................................................................414
11.4.1 Name.........................................................................................................................414
11.4.2 Control Implementation.............................................................................................414
11.4.3 Bind to XForms.........................................................................................................414
11.5 Common Control Attributes..............................................................................................415
11.5.1 Button Type...............................................................................................................415
11.5.2 Control ID..................................................................................................................415
11.5.3 Current Selected.......................................................................................................416
11.5.4 Value and Current Value...........................................................................................416
11.5.5 Disabled.....................................................................................................................418
11.5.6 Dropdown..................................................................................................................418
11.5.7 For.............................................................................................................................419
11.5.8 Image Data................................................................................................................419
11.5.9 Label..........................................................................................................................419
11.5.10 Maximum Length....................................................................................................420
11.5.11 Printable..................................................................................................................420
11.5.12 Read only................................................................................................................421
11.5.13 Selected..................................................................................................................421
11.5.14 Size..........................................................................................................................422
11.5.15 Tab Index................................................................................................................422
11.5.16 Tab Stop..................................................................................................................423
11.5.17 Target Frame..........................................................................................................424
11.5.18 Target Location.......................................................................................................424
11.5.19 Title..........................................................................................................................424
11.5.20 Visual Effect............................................................................................................425
11.5.21 Relative Image Position..........................................................................................425
11.5.22 Database Binding Attributes...................................................................................426
11.6 Events...............................................................................................................................428
11.6.1 Events with an Equivalent HTML Event Type..........................................................428
11.6.2 Event Types..............................................................................................................429
11.7 Properties..........................................................................................................................431
11.7.1 Property Set..............................................................................................................431
11.7.2 Property.....................................................................................................................431
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 15 of 706

11.7.3 List Property..............................................................................................................432
12 Common Content.....................................................................................................................435
12.1 Annotation.........................................................................................................................435
12.1.1 Creator.......................................................................................................................436
12.1.2 Creation Date and Time............................................................................................436
12.1.3 Creation Date and Time String.................................................................................436
12.2 Number Format................................................................................................................436
12.2.1 Prefix and Suffix.......................................................................................................436
12.2.2 Format Specification.................................................................................................437
12.2.3 Letter Synchronization in Number Formats..............................................................437
12.3 Change Tracking Metadata..............................................................................................438
12.4 Event Listener Tables.......................................................................................................438
12.4.1 Event Listener...........................................................................................................439
12.5 Mathematical Content......................................................................................................440
12.6 DDE Connections.............................................................................................................440
12.6.1 Container for DDE Connection Declarations............................................................441
12.6.2 Declaring DDE Connections for Text Fields.............................................................441
12.6.3 Declaring DDE Connections for Tables ...................................................................442
13 SMIL Animations......................................................................................................................445
13.1 Basic Animation Elements...............................................................................................445
13.1.1 Animate.....................................................................................................................445
13.1.2 Set.............................................................................................................................445
13.1.3 Animate Motion.........................................................................................................445
13.1.4 Animate Color...........................................................................................................446
13.1.5 Animate Transform...................................................................................................447
13.1.6 Transition Filter.........................................................................................................448
13.2 Animation Model Attributes..............................................................................................449
13.3 Common Animation Attributes.........................................................................................449
13.3.1 Animation Target Attributes......................................................................................450
13.3.2 Animation Function Attributes...................................................................................450
13.4 Animation Timing.............................................................................................................453
13.4.1 Animation Timing Attributes......................................................................................453
13.4.2 Parallel Animations...................................................................................................456
13.4.3 Sequential Animations..............................................................................................457
13.4.4 Iterative Animations..................................................................................................457
13.5 Media Elements................................................................................................................458
13.5.1 Audio.........................................................................................................................458
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 16 of 706

13.6 Special Elements..............................................................................................................459
13.6.1 Command..................................................................................................................459
14 Styles........................................................................................................................................460
14.1 Style Element...................................................................................................................460
14.1.1 Style Mappings..........................................................................................................464
14.2 Default Styles...................................................................................................................466
14.3 Page Layout......................................................................................................................466
14.3.1 Header and Footer Styles.........................................................................................467
14.4 Master Pages....................................................................................................................468
14.4.1 Headers and Footers.................................................................................................470
14.4.2 Presentation Notes....................................................................................................472
14.5 Table Templates...............................................................................................................473
14.5.1 Row and Column Styles............................................................................................475
14.6 Font Face Declaration......................................................................................................476
14.6.1 CSS2/SVG Font Descriptors.....................................................................................477
14.6.2 Name.........................................................................................................................480
14.6.3 Adornments...............................................................................................................481
14.6.4 Font Family Generic.................................................................................................481
14.6.5 Font Pitch..................................................................................................................481
14.6.6 Font Character Set....................................................................................................481
14.7 Data Styles.......................................................................................................................481
14.7.1 Number Style............................................................................................................482
14.7.2 Currency Style...........................................................................................................486
14.7.3 Percentage Style.......................................................................................................487
14.7.4 Date Style..................................................................................................................488
14.7.5 Time Style.................................................................................................................494
14.7.6 Boolean Style............................................................................................................497
14.7.7 Text Style..................................................................................................................498
14.7.8 Common Data Style Elements................................................................................. 498
14.7.9 Common Data Style Attributes.................................................................................499
14.7.10 Transliteration.........................................................................................................502
14.7.11 Common Data Style Child Element Attributes....................................................... 503
14.8 Text Styles........................................................................................................................505
14.8.1 Text Styles................................................................................................................505
14.8.2 Paragraph Styles.......................................................................................................505
14.8.3 Section Styles...........................................................................................................506
14.8.4 Ruby Style.................................................................................................................506
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 17 of 706

14.9 Enhanced Text Styles.......................................................................................................506
14.9.1 Line Numbering Configuration..................................................................................506
14.9.2 Notes Configuration Element....................................................................................510
14.9.3 Bibliography Configuration........................................................................................513
14.10 List Style.........................................................................................................................515
14.10.1 Common List-Level Style Attributes.......................................................................516
14.10.2 Number Level Style................................................................................................517
14.10.3 Bullet Level Style....................................................................................................518
14.10.4 Image Level Style...................................................................................................520
14.10.5 List Level Style Example........................................................................................520
14.11 Outline Style...................................................................................................................521
14.11.1 Outline Level Style..................................................................................................521
14.12 Table Styles....................................................................................................................523
14.12.1 Table Styles.............................................................................................................523
14.12.2 Table Column Styles...............................................................................................523
14.12.3 Table Row Styles....................................................................................................523
14.12.4 Table Cell Styles.....................................................................................................524
14.13 Graphic Styles................................................................................................................524
14.13.1 Graphic and Presentation Styles............................................................................524
14.13.2 Drawing Page Style.................................................................................................525
14.14 Enhanced Graphic Style Elements................................................................................526
14.14.1 Gradient...................................................................................................................526
14.14.2 SVG Gradients........................................................................................................529
14.14.3 Hatch.......................................................................................................................532
14.14.4 Fill Image.................................................................................................................533
14.14.5 Opacity Gradient.....................................................................................................535
14.14.6 Marker.....................................................................................................................535
14.14.7 Stroke Dash.............................................................................................................536
14.15 Presentation Page Layouts............................................................................................538
14.15.1 Presentation Placeholder........................................................................................538
14.16 Chart Styles....................................................................................................................539
15 Formatting Properties..............................................................................................................540
15.1 Simple and Complex Formatting Properties....................................................................540
15.1.1 Simple Formatting Properties...................................................................................540
15.1.2 Complex Formatting Properties................................................................................541
15.1.3 Processing Rules for Formatting Properties.............................................................541
15.2 Page Layout Formatting Properties.................................................................................541
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 18 of 706

15.2.1 Page Size..................................................................................................................542
15.2.2 Page Number Format...............................................................................................542
15.2.3 Paper Tray.................................................................................................................543
15.2.4 Print Orientation........................................................................................................543
15.2.5 Margins......................................................................................................................543
15.2.6 Border........................................................................................................................544
15.2.7 Border Line Width.....................................................................................................544
15.2.8 Padding.....................................................................................................................544
15.2.9 Shadow......................................................................................................................544
15.2.10 Background.............................................................................................................544
15.2.11 Columns..................................................................................................................545
15.2.12 Register-truth...........................................................................................................545
15.2.13 Print.........................................................................................................................545
15.2.14 Print Page Order.....................................................................................................546
15.2.15 First Page Number..................................................................................................546
15.2.16 Scale........................................................................................................................546
15.2.17 Table Centering.......................................................................................................547
15.2.18 Maximum Footnote Height.....................................................................................547
15.2.19 Writing Mode...........................................................................................................547
15.2.20 Footnote Separator.................................................................................................548
15.2.21 Layout Grid..............................................................................................................549
15.2.22 Layout Grid Base Height.........................................................................................549
15.2.23 Layout Grid Ruby Height.........................................................................................550
15.2.24 Layout Grid Lines....................................................................................................550
15.2.25 Layout Grid Color....................................................................................................550
15.2.26 Layout Grid Ruby Below.........................................................................................550
15.2.27 Layout Grid Print.....................................................................................................550
15.2.28 Layout Grid Display.................................................................................................551
15.3 Header Footer Formatting Properties..............................................................................551
15.3.1 Fixed and Minimum heights......................................................................................551
15.3.2 Margins......................................................................................................................552
15.3.3 Border........................................................................................................................552
15.3.4 Border Line Width.....................................................................................................552
15.3.5 Padding.....................................................................................................................552
15.3.6 Background...............................................................................................................553
15.3.7 Shadow......................................................................................................................553
15.3.8 Dynamic Spacing......................................................................................................553
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 19 of 706

15.4 Text Formatting Properties...............................................................................................553
15.4.1 Font Variant...............................................................................................................554
15.4.2 Text Transformations................................................................................................554
15.4.3 Color..........................................................................................................................554
15.4.4 Window Font Color...................................................................................................555
15.4.5 Text Outline...............................................................................................................555
15.4.6 Line Through Type....................................................................................................555
15.4.7 Line Through Style....................................................................................................555
15.4.8 Line Through Width...................................................................................................556
15.4.9 Line Through Color...................................................................................................556
15.4.10 Line Through Text...................................................................................................556
15.4.11 Line Through Text Style..........................................................................................557
15.4.12 Text Position...........................................................................................................557
15.4.13 Font Name...............................................................................................................557
15.4.14 Font Family.............................................................................................................558
15.4.15 Font Family Generic...............................................................................................558
15.4.16 Font Style................................................................................................................559
15.4.17 Font Pitch................................................................................................................560
15.4.18 Font Character Set..................................................................................................560
15.4.19 Font Size.................................................................................................................561
15.4.20 Relative Font Size...................................................................................................561
15.4.21 Script Type..............................................................................................................562
15.4.22 Letter Spacing.........................................................................................................562
15.4.23 Language.................................................................................................................563
15.4.24 Country....................................................................................................................563
15.4.25 Font Style................................................................................................................564
15.4.26 Font Relief...............................................................................................................564
15.4.27 Text Shadow...........................................................................................................564
15.4.28 Underlining Type.....................................................................................................565
15.4.29 Underlining Style.....................................................................................................565
15.4.30 Underling Width......................................................................................................566
15.4.31 Underline Color.......................................................................................................566
15.4.32 Font Weight.............................................................................................................566
15.4.33 Text Underline Word Mode.....................................................................................567
15.4.34 Text Line Through Word Mode...............................................................................567
15.4.35 Letter Kerning..........................................................................................................568
15.4.36 Text Blinking...........................................................................................................568
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 20 of 706

15.4.37 Text Background Color...........................................................................................568
15.4.38 Text Combine..........................................................................................................568
15.4.39 Text Combine Start and End Characters................................................................569
15.4.40 Text Emphasis........................................................................................................569
15.4.41 Text Scale...............................................................................................................570
15.4.42 Text Rotation Angle................................................................................................570
15.4.43 Text Rotation Scale.................................................................................................570
15.4.44 Hyphenation............................................................................................................570
15.4.45 Hyphenation Remain Char Count...........................................................................571
15.4.46 Hyphenation Push Char Count...............................................................................571
15.4.47 Hidden or Conditional Text.....................................................................................571
15.5 Paragraph Formatting Properties.....................................................................................572
15.5.1 Fixed Line Height......................................................................................................572
15.5.2 Minimum Line Height................................................................................................572
15.5.3 Line Distance.............................................................................................................573
15.5.4 Font-Independent Line Spacing................................................................................573
15.5.5 Text Align..................................................................................................................573
15.5.6 Text Align of Last Line..............................................................................................574
15.5.7 Justify Single Word...................................................................................................574
15.5.8 Keep Together...........................................................................................................574
15.5.9 Widows......................................................................................................................575
15.5.10 Orphans...................................................................................................................575
15.5.11 Tab Stops................................................................................................................575
15.5.12 Tab Stop Distance...................................................................................................578
15.5.13 Hyphenation Keep...................................................................................................579
15.5.14 Maximum Hyphens.................................................................................................579
15.5.15 Drop Caps...............................................................................................................579
15.5.16 Register True ..........................................................................................................581
15.5.17 Left and Right Margins............................................................................................581
15.5.18 Text Indent..............................................................................................................581
15.5.19 Automatic Text Indent.............................................................................................582
15.5.20 Top and Bottom Margins.........................................................................................582
15.5.21 Margins....................................................................................................................583
15.5.22 Break Before and Break After.................................................................................583
15.5.23 Paragraph Background Color..................................................................................584
15.5.24 Paragraph Background Image................................................................................584
15.5.25 Border......................................................................................................................586
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 21 of 706

15.5.26 Border Line Width...................................................................................................587
15.5.27 Padding...................................................................................................................588
15.5.28 Shadow....................................................................................................................589
15.5.29 Keep with Next........................................................................................................589
15.5.30 Line Numbering.......................................................................................................589
15.5.31 Line Number Start Value.........................................................................................590
15.5.32 Text Autospace.......................................................................................................590
15.5.33 Punctuation Wrap...................................................................................................590
15.5.34 Line Break...............................................................................................................590
15.5.35 Vertical Alignment...................................................................................................591
15.5.36 Writing Mode...........................................................................................................591
15.5.37 Automatic Writing Mode.........................................................................................592
15.5.38 Snap To Layout.......................................................................................................592
15.5.39 Page Number..........................................................................................................592
15.5.40 Background Transparency......................................................................................593
15.6 Ruby Text Formatting Properties.....................................................................................593
15.6.1 Ruby Position............................................................................................................593
15.6.2 Ruby Alignment.........................................................................................................593
15.7 Section Formatting Properties..........................................................................................594
15.7.1 Section Background..................................................................................................594
15.7.2 Margins......................................................................................................................594
15.7.3 Columns....................................................................................................................594
15.7.4 Column Specification................................................................................................595
15.7.5 Column Separator.....................................................................................................597
15.7.6 Protect.......................................................................................................................598
15.7.7 Don't Balance Text Columns....................................................................................599
15.7.8 Writing Mode.............................................................................................................599
15.7.9 Notes Configuration..................................................................................................599
15.8 Table Formatting Properties.............................................................................................599
15.8.1 Table Width...............................................................................................................599
15.8.2 Table Alignment........................................................................................................600
15.8.3 Table Left and Right Margin.....................................................................................600
15.8.4 Table Top and Bottom Margin..................................................................................601
15.8.5 Table Margins............................................................................................................601
15.8.6 Page Number............................................................................................................601
15.8.7 Break Before and Break After...................................................................................601
15.8.8 Table Background and Background Image.............................................................. 601
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 22 of 706

15.8.9 Table Shadow...........................................................................................................602
15.8.10 Keep with Next........................................................................................................602
15.8.11 May Break Between Rows......................................................................................602
15.8.12 Border Model Property............................................................................................602
15.8.13 Writing Mode...........................................................................................................603
15.8.14 Display.....................................................................................................................603
15.9 Column Formatting Properties.........................................................................................603
15.9.1 Column Width...........................................................................................................603
15.9.2 Optimal Table Column Width...................................................................................604
15.9.3 Break Before and Break After...................................................................................604
15.10 Table Row Formatting Properties..................................................................................604
15.10.1 Row Height..............................................................................................................605
15.10.2 Optimal Table Row Height......................................................................................605
15.10.3 Row Background.....................................................................................................605
15.10.4 Break Before and Break After.................................................................................605
15.10.5 Keep Together.........................................................................................................606
15.11 Table Cell Formatting Properties...................................................................................606
15.11.1 Vertical Alignment...................................................................................................606
15.11.2 Text Align Source....................................................................................................607
15.11.3 Direction..................................................................................................................607
15.11.4 Vertical Glyph Orientation.......................................................................................607
15.11.5 Cell Shadow............................................................................................................607
15.11.6 Cell Background......................................................................................................608
15.11.7 Cell Border..............................................................................................................608
15.11.8 Diagonal Lines.........................................................................................................608
15.11.9 Border Line Width...................................................................................................609
15.11.10 Padding.................................................................................................................609
15.11.11 Wrap Option..........................................................................................................609
15.11.12 Rotation Angle.......................................................................................................609
15.11.13 Rotation Align........................................................................................................610
15.11.14 Cell Protect............................................................................................................610
15.11.15 Print Content.........................................................................................................610
15.11.16 Decimal places......................................................................................................611
15.11.17 Repeat Content.....................................................................................................611
15.11.18 Shrink To Fit..........................................................................................................611
15.12 List-Level Style Properties.............................................................................................611
15.13 Stroke Properties............................................................................................................614
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 23 of 706

15.13.1 Stroke Style.............................................................................................................614
15.13.2 Dash........................................................................................................................614
15.13.3 Multiple Dashes.......................................................................................................615
15.13.4 Width.......................................................................................................................615
15.13.5 Color........................................................................................................................615
15.13.6 Start Marker.............................................................................................................615
15.13.7 End Marker..............................................................................................................615
15.13.8 Start Marker Width..................................................................................................616
15.13.9 End Marker Width...................................................................................................616
15.13.10 Start Marker Center...............................................................................................616
15.13.11 End Marker Center................................................................................................616
15.13.12 Opacity..................................................................................................................617
15.13.13 Line Join................................................................................................................617
15.14 Fill Properties..................................................................................................................617
15.14.1 Fill Style...................................................................................................................618
15.14.2 Color........................................................................................................................618
15.14.3 Secondary Fill Color................................................................................................618
15.14.4 Gradient...................................................................................................................619
15.14.5 Gradient Step Count...............................................................................................619
15.14.6 Hatch.......................................................................................................................619
15.14.7 Solid Hatch..............................................................................................................619
15.14.8 Fill Image.................................................................................................................620
15.14.9 Fill Image Rendering Style.....................................................................................620
15.14.10 Fil Image Size......................................................................................................620
15.14.11 Fil Image Tile Reference Point............................................................................621
15.14.12 Fil Image Tile Translation....................................................................................621
15.14.13 None and Linear Opacity......................................................................................622
15.14.14 Gradient Opacity...................................................................................................622
15.14.15 Fil Rule.................................................................................................................622
15.14.16 Symbol color.........................................................................................................622
15.15 Text Animation Properties..............................................................................................623
15.15.1 Animation................................................................................................................623
15.15.2 Animation Direction.................................................................................................623
15.15.3 Animation Start Inside.............................................................................................624
15.15.4 Animation Stop Inside.............................................................................................624
15.15.5 Animation Repeat....................................................................................................624
15.15.6 Animation Delay......................................................................................................624
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 24 of 706

15.15.7 Animation Steps......................................................................................................625
15.16 Text and Text Alignment Properties..............................................................................625
15.16.1 Auto Grow Width and Height..................................................................................625
15.16.2 Fit To Size...............................................................................................................625
15.16.3 Fit To Contour.........................................................................................................625
15.16.4 Text Area Vertical Align..........................................................................................626
15.16.5 Text Area Horizontal Align......................................................................................626
15.16.6 Word Wrap..............................................................................................................626
15.16.7 List Styles................................................................................................................627
15.17 Color Properties..............................................................................................................627
15.17.1 Color Mode .............................................................................................................627
15.17.2 Color Inversion........................................................................................................627
15.17.3 Adjust Luminance....................................................................................................628
15.17.4 Adjust Contrast........................................................................................................628
15.17.5 Adjust Gamma........................................................................................................628
15.17.6 Adjust Red...............................................................................................................628
15.17.7 Adjust Green...........................................................................................................628
15.17.8 Adjust Blue..............................................................................................................629
15.17.9 Adjust Opacity.........................................................................................................629
15.18 Shadow Properties.........................................................................................................629
15.18.1 Shadow....................................................................................................................629
15.18.2 Offset.......................................................................................................................629
15.18.3 Color........................................................................................................................630
15.18.4 Opacity....................................................................................................................630
15.19 Connector Properties......................................................................................................630
15.19.1 Start Line Spacing...................................................................................................630
15.19.2 End Line Spacing....................................................................................................631
15.20 Measure Properties........................................................................................................631
15.20.1 Line Distance...........................................................................................................631
15.20.2 Guide Overhang......................................................................................................631
15.20.3 Guide Distance........................................................................................................632
15.20.4 Start Guide..............................................................................................................632
15.20.5 End Guide...............................................................................................................632
15.20.6 Placing.....................................................................................................................632
15.20.7 Parallel....................................................................................................................633
15.20.8 Text Alignment........................................................................................................633
15.20.9 Unit..........................................................................................................................633
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 25 of 706

15.20.10 Show Unit..............................................................................................................634
15.20.11 Decimal Places.....................................................................................................634
15.21 Caption Properties..........................................................................................................634
15.21.1 Type.........................................................................................................................634
15.21.2 Angle Type..............................................................................................................635
15.21.3 Angle.......................................................................................................................635
15.21.4 Gap..........................................................................................................................635
15.21.5 Escape Direction.....................................................................................................635
15.21.6 Escape.....................................................................................................................636
15.21.7 Line Length..............................................................................................................636
15.21.8 Fit Line Length........................................................................................................636
15.22 3D Geometry Properties.................................................................................................636
15.22.1 Horizontal Segments...............................................................................................637
15.22.2 Vertical Segments...................................................................................................637
15.22.3 Edge Rounding........................................................................................................637
15.22.4 Edge Rounding Mode..............................................................................................637
15.22.5 Back Scale..............................................................................................................638
15.22.6 Depth.......................................................................................................................638
15.22.7 Backface Culling.....................................................................................................638
15.22.8 End Angle................................................................................................................638
15.22.9 Close Front..............................................................................................................639
15.22.10 Close Back............................................................................................................639
15.23 3D Lighting Properties....................................................................................................639
15.23.1 Mode........................................................................................................................639
15.23.2 Normals Kind...........................................................................................................639
15.23.3 Normals Direction....................................................................................................640
15.24 3D Texture Properties....................................................................................................640
15.24.1 Generation Mode.....................................................................................................640
15.24.2 Kind.........................................................................................................................641
15.24.3 Filter........................................................................................................................641
15.24.4 Mode........................................................................................................................641
15.25 3D Material Properties....................................................................................................641
15.25.1 Colors......................................................................................................................642
15.25.2 Shininess.................................................................................................................642
15.26 3D Shadow Properties....................................................................................................642
15.26.1 Shadow....................................................................................................................642
15.27 Frame Formatting Properties.........................................................................................643
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 26 of 706

15.27.1 Frame Widths..........................................................................................................643
15.27.2 Frame Heights.........................................................................................................643
15.27.3 Maximum Width and Height...................................................................................643
15.27.4 Left and Right Margins............................................................................................644
15.27.5 Top and Bottom Margins.........................................................................................644
15.27.6 Margins....................................................................................................................644
15.27.7 Print Content...........................................................................................................644
15.27.8 Protect.....................................................................................................................645
15.27.9 Horizontal Position..................................................................................................645
15.27.10 Horizontal Relation................................................................................................646
15.27.11 Vertical Position....................................................................................................647
15.27.12 Vertical Relation....................................................................................................648
15.27.13 Frame Anchor.......................................................................................................649
15.27.14 Border....................................................................................................................649
15.27.15 Border Line Width.................................................................................................649
15.27.16 Padding.................................................................................................................649
15.27.17 Shadow..................................................................................................................650
15.27.18 Background...........................................................................................................650
15.27.19 Columns................................................................................................................650
15.27.20 Editable.................................................................................................................650
15.27.21 Wrapping...............................................................................................................650
15.27.22 Dynamic Wrap Threshold.....................................................................................651
15.27.23 Paragraph-only Wrapping.....................................................................................651
15.27.24 Contour Wrapping.................................................................................................652
15.27.25 Contour Wrapping Mode.......................................................................................652
15.27.26 Run Through.........................................................................................................652
15.27.27 Flow with Text.......................................................................................................653
15.27.28 Overflow behavior.................................................................................................653
15.27.29 Mirroring................................................................................................................653
15.27.30 Clipping.................................................................................................................654
15.27.31 Wrap Influence on Position...................................................................................654
15.28 Floating Frame Formatting Properties...........................................................................655
15.28.1 Display Scrollbar.....................................................................................................655
15.28.2 Display Border.........................................................................................................655
15.28.3 Margins....................................................................................................................656
15.28.4 Object Formatting Properties..................................................................................656
15.28.5 Visible Area.............................................................................................................656
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 27 of 706

15.28.6 Draw Aspect............................................................................................................657
15.29 Chart Formatting Properties...........................................................................................657
15.29.1 Scale Text...............................................................................................................658
15.30 Chart Subtype Properties...............................................................................................658
15.30.1 Three-dimensional Charts.......................................................................................658
15.30.2 Chart Depth.............................................................................................................658
15.30.3 Chart Symbol..........................................................................................................658
15.30.4 Chart Symbol Size..................................................................................................659
15.30.5 Bar Chart Properties...............................................................................................659
15.30.6 Stock Chart Properties............................................................................................660
15.30.7 Line Chart Properties..............................................................................................661
15.30.8 Pie Chart Properties................................................................................................661
15.30.9 Lines........................................................................................................................661
15.30.10 Solid Charts Bars..................................................................................................662
15.30.11 Stacked Chart Bars...............................................................................................662
15.31 Chart Axes Properties....................................................................................................662
15.31.1 Linked Data Formats...............................................................................................662
15.31.2 Visibility...................................................................................................................663
15.31.3 Scaling.....................................................................................................................663
15.31.4 Tickmarks................................................................................................................664
15.31.5 Labels......................................................................................................................664
15.32 Common Chart Properties..............................................................................................665
15.32.1 Stacked Text...........................................................................................................665
15.32.2 Rotation Angle.........................................................................................................665
15.32.3 Data Labels.............................................................................................................666
15.33 Statistical Properties.......................................................................................................667
15.33.1 Mean Value.............................................................................................................667
15.33.2 Error Category.........................................................................................................667
15.34 Plot Area Properties.......................................................................................................669
15.34.1 Series Source..........................................................................................................669
15.35 Regression Curve Properties.........................................................................................669
15.35.1 Regression Type.....................................................................................................669
15.36 Presentation Page Attributes..........................................................................................670
15.36.1 Transition Type.......................................................................................................670
15.36.2 Transition Style.......................................................................................................671
15.36.3 Transition Speed.....................................................................................................673
15.36.4 Transition Type or Family.......................................................................................673
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 28 of 706

15.36.5 Transition Subtype..................................................................................................673
15.36.6 Transition Direction.................................................................................................674
15.36.7 Fade Color...............................................................................................................674
15.36.8 Page Duration.........................................................................................................674
15.36.9 Page Visibility..........................................................................................................674
15.36.10 Sound....................................................................................................................675
15.36.11 Background Size...................................................................................................675
15.36.12 Background Objects Visible..................................................................................675
15.36.13 Background Visible...............................................................................................675
15.36.14 Display Header......................................................................................................676
15.36.15 Display Footer.......................................................................................................676
15.36.16 Display Page Number...........................................................................................676
15.36.17 Display Date And Time.........................................................................................676
16 Data Types and Schema Definitions.......................................................................................677
16.1 Data Types........................................................................................................................677
16.2 Other Definitions...............................................................................................................682
16.3 Relax-NG Schema Suffix.................................................................................................683
17 Packages..................................................................................................................................684
17.1 Introduction.......................................................................................................................684
17.2 Zip File Structure..............................................................................................................684
17.3 Encryption.........................................................................................................................685
17.4 MIME Type Stream..........................................................................................................685
17.5 Usage of URIs Within Packages......................................................................................686
17.6 Preview Image..................................................................................................................686
17.7 Manifest File.....................................................................................................................687
17.7.1 Relax-NG Schema....................................................................................................687
17.7.2 Manifest Root Element..............................................................................................687
17.7.3 File Entry...................................................................................................................687
17.7.4 Encryption Data.........................................................................................................689
17.7.5 Algorithm...................................................................................................................689
17.7.6 Key Derivation...........................................................................................................690
17.7.7 Relax-NG Schema Suffix..........................................................................................692
Appendix A. Strict Relax NG Schema..........................................................................................693
Appendix B. References...............................................................................................................695
Appendix C. MIME Types and File Name Extensions (Non Normative).....................................697
Appendix D. Core Features Sets (Non Normative)......................................................................699
Appendix E. Changes From Previous Specification Versions (Non Normative)......................... 704
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 29 of 706

E.1. Changes from “Open Office Specification 1.0 Committee Draft 1”......................................704
E.2. Changes from “Open Document Format for Office Applications (OpenDocument) 1.0
Committee Draft 2”.......................................................................................................................704
Appendix F. Notices......................................................................................................................706
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 30 of 706

1 Introduction
1.1 Introduction
This document defines an XML schema for office applications and its semantics. The schema is
suitable for office documents, including text documents, spreadsheets, charts and graphical
documents like drawings or presentations, but is not restricted to these kinds of documents.
The schema provides for high-level information suitable for editing documents. It defines suitable
XML structures for office documents and is friendly to transformations using XSLT or similar
XML-based tools.
Chapter 1 contains an introduction to the OpenDocument format. The structure of documents
that conform to the OpenDocument specification is explained in chapter 2. Chapter 3 described
the meta information that can be contained in such documents. Chapters 4 and 5 describe their
text and paragraph content. Text Fields are described in chapter 6, text indices in chapter 7.
Chapter 8 describes the table content of an document in OpenDocument format, chapter 9 its
graphical content, chapter 10 its chart content, and chapter 11 its form content. Content that is
common to all documents is described in chapter 12. The integration of SMIL animation markup
into the OpenDocument schema is described in chapter 13. Chapter 14 explains style
information content, chapter 15 specifies formatting properties that are can be used within styles.
The data types used by the OpenDocument schema are described in chapter 16.
The OpenDocument format makes use of a package concept. These packages are described in
chapter 17.
1.2 Notation
Within this specification, the key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" are
to be interpreted as described in [RFC2119] if they appear in uppercase bold letters.
1.3 Namespaces
Table 1 lists the namespaces that are defined by the OpenDocument format and their default
prefixes. For more information about XML namespaces, please refer to the Namespaces in XML
specification [xml-names].
Table 1: XML Namespaces defined by the OpenDocument schema
Prefix
Description
Namespace
office
For all common pieces of information urn:oasis:names:tc:opendocument:xmlns:
that are not contained in another,
office:1.0
more specific namespace.
meta
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe meta information.
meta:1.0
config
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe application specific settings. config:1.0
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 31 of 706

Prefix
Description
Namespace
text
For elements and attributes that may
urn:oasis:names:tc:opendocument:xmlns:
occur within text documents and text
text:1.0
parts of other document types, such
as the contents of a spreadsheet cell.
table
For elements and attributes that may
urn:oasis:names:tc:opendocument:xmlns:
occur within spreadsheets or within
table:1.0
table definitions of a text document.
drawing
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe graphic content.
drawing:1.0
presentation For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe presentation content.
presentation:1.0
dr3d
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe 3D graphic content.
dr3d:1.0
anim
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe animation content.
animation:1.0
chart
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe chart content.
chart:1.0
form
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe forms and controls.
form:1.0
script
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
represent scripts or events.
script:1.0
style
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe the style and inheritance
style:1.0
model used by the OpenDocument
format as well as some common
formatting attributes.
number
For elements and attributes that
urn:oasis:names:tc:opendocument:xmlns:
describe data style information.
data style:1.0
manifest
For elements and attribute contained
urn:oasis:names:tc:opendocument:xmlns:
in the package manifest.
manifest:1.0
Table 2lists the namespaces that are defined by the OpenDocument format, but contain
elements and attributes whose semantics are compatible to elements and attributes from other
specifications.
Table 2: XML Namespaces defined by the OpenDocument schema that include elements and
attributes that are compatible to elements and attributes of other standards.

Prefix
Description
Namespace
fo
For attributes that are compatible to
urn:oasis:names:tc:opendocument:xmlns:
attributes defined in [XSL].
xsl-fo-compatible:1.0
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 32 of 706

Prefix
Description
Namespace
svg
For elements and attributes that are
urn:oasis:names:tc:opendocument:xmlns:
compatible to elements or attributes
svg-compatible:1.0
defined in [SVG].
smil
For attributes that are compatible to
urn:oasis:names:tc:opendocument:xmlns:
attributes defined in [SMIL20].
smil-compatible:1.0
Table 3 lists the namespaces that are imported into the OpenDocument format and their default
prefixes.
Table 3: XML Namespaces used by the OpenDocument schema
Prefix
Description
Namespace
dc
The Dublin Core Namespace (see
http://purl.org/dc/elements/1.1/
[DCMI]).
xlink
The XLink namespace (see [XLink]).
http://www.w3.org/1999/xlink
math
MathML Namespace (see [MathML])
http://www.w3.org/1998/Math/MathML
xforms
The XForms namespace (see
http://www.w3.org/2002/xforms
[XForms]).
1.4 Relax-NG Schema
The normative XML Schema for the OpenDocument format is embedded within this
specification. It can be obtained from the specification document by concatenating all schema
fragments contained in chapters 1 to 16. All schema fragments have a gray background color
and line numbers.
The schema language used within this specification is Relax-NG (see [RNG]).
The schema provided in this specification permits arbitrary content within meta information
elements and formatting properties elements as described in section 1.5. Appendix A contains a
schema that restricts the content within these elements to the attributes and elements defined in
this specification.
Prefix for the normative Relax-NG schema:
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
OASIS OpenDocument v1.0
4
OASIS Standard, 1 May 2005
5
Relax-NG Schema
6
7
$Id$
8
9
© 2002-2005 OASIS Open
10
© 1999-2005 Sun Microsystems, Inc.
11
-->
12
13
<grammar
14
xmlns="http://relaxng.org/ns/structure/1.0"
15
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
16
17
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
18
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 33 of 706

19
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
20
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
21
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0"
22
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
23
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
24
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
25
xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
26
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
27
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
28
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
29
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
30
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
31
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
32
xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0"
33
34
xmlns:dc="http://purl.org/dc/elements/1.1/"
35
xmlns:xlink="http://www.w3.org/1999/xlink"
36
xmlns:math="http://www.w3.org/1998/Math/MathML"
37
xmlns:xforms="http://www.w3.org/2002/xforms"
38
39
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
40
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
41
xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0"
42
>
1.5 Document Processing and Conformance
Documents that conform to the OpenDocument specification MAY contain elements and
attributes not specified within the OpenDocument schema. Such elements and attributes must
not be part of a namespace that is defined within this specification and are called foreign
elements and attributes.
Conforming applications either MUST read documents that are valid against the OpenDocument
schema if all foreign elements and attributes are removed before validation takes place, or
MUST write documents that are valid against the OpenDocument schema if all foreign elements
and attributes are removed before validation takes place.
Conforming applications that read and write documents MAY preserve foreign elements and
attributes.
In addition to this, conforming applications should preserve meta information and the content of
styles. This means:

The various <style:*-properties> elements (see section 15) MAY have arbitrary
attributes attached and MAY have arbitrary element content. All attributes attached to these
elements and elements contained within these elements SHOULD be preserved (see section
15.1.3);

elements contained within the <office:meta> element MAY have arbitrary element
content and SHOULD be preserved (see section 2.2.1).
Foreign elements MAY have an office:process-content attribute attached that has the
value true or false. If the attribute's value is true, or if the attribute does not exist, the
element's content SHOULD be processed by conforming applications. Otherwise conforming
applications SHOULD NOT process the element's content, but MAY only preserve its content. If
the element's content should be processed, the document itself MUST be valid against the
OpenDocument schema if the unknown element is replaced with its content only.
Conforming applications MUST read documents containing processing instructions and
SHOULD preserve them.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 34 of 706

There are no rules regarding the elements and attributes that actually have to be supported by
conforming applications, except that applications should not use foreign elements and attributes
for features by the OpenDocument schema. See also appendix D.
43
<define name="office-process-content">
44
<optional>
45
<attribute name="office:process-content" a:defaultValue="true">
46
<ref name="boolean"/>
47
</attribute>
48
</optional>
49
</define>
1.6 White-Space Processing and EOL Handling
In conformance with the W3C XML specification [XML1.0], optional white-space characters that
are contained in elements that have element content (in other words that must contain elements
only but not text) are ignored. This applies to the following white-space and end-of-line (EOL)
Unicode characters:

HORIZONTAL TABULATION (0x0009)

LINE FEED (0x000A)

CARRIAGE RETURN (0x000D)

SPACE (0x0020)
For any other element, white-spaces are preserved by default. Unless otherwise stated, there is
no special processing for any of the four white-space characters. For some elements, different
white-space processing may take place, for example the paragraph element.
The XML specification also requires that any of the four white-space characters that is contained
in an attribute value is normalized to a SPACE character.
One of the following characters may be used to represent line ends:

LINE FEED

CARRIAGE RETURN

The sequence of the characters CARRIAGE RETURN and LINE FEED
Conforming to the XML specification, all the possible line ends are normalized to a single LINE
FEED character.
As a consequence of the white-space and EOL processing rules, any CARRIAGE RETURN
characters that are contained either in the text content of an element or in an attribute value
must be encoded by the character entity &#x0D;. The same applies to the HORIZONTAL
TABULATION and LINE FEED characters if they are contained in an attribute value.
1.7 MIME Types and File Name Extensions
Appendix C contains a list of MIME types and file name extensions to be used for office
documents that conform to this specification and that are contained in a package (see section
2.1). This MIME types and extensions either have been registered following the procedures
described in [RFC2048], or a registration is in progress.
For office documents that conform to this specification but are not contained in a package, it is
RECOMMENDED to use the MIME type text/xml.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 35 of 706

It is RECOMMENDED that only MIME types and extensions that have been registered according
to [RFC2048] are used for office documents that conform to this specification. It is also
RECOMMENDED that the MIME types and extensions listed in appendix C are used where
appropriate.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 36 of 706

2 Document Structure
This chapter introduces the structure of the OpenDocument format. The chapter contains the
following sections:

Document Roots

Document Metadata

Body Element and Document Types

Application Settings

Scripts

Font Face Declarations

Styles

Page Styles and Layout
In the OpenDocument format, each structural component is represented by an element, with
associated attributes. The structure of a document in OpenDocument format applies to all
document types. There is no difference between a text document, a spreadsheet or a drawing,
apart from the content. Also, all document types may contain different styles. Document content
that is common to all document types can be exchanged from one type of document to another.
2.1 Document Roots
A document root element is the primary element of a document in OpenDocument format. It
contains the entire document. All types of documents, for example, text documents,
spreadsheets, and drawing documents use the same types of document root elements.
The OpenDocument format supports the following two ways of document representation:

As a single XML document.

As a collection of several subdocuments within a package (see section 17), each of which
stores part of the complete document. Each subdocument has a different document root and
stores a particular aspect of the XML document. For example, one subdocument contains
the style information and another subdocument contains the content of the document. All
types of documents, for example, text and spreadsheet documents, use the same document
and subdocuments definitions.
There are four types of subdocuments, each with different root elements. Additionally, the single
XML document has its own root element, for a total of five different supported root elements. The
root elements are summarized in the following table:
Root Element
Subdocument Content
Subdoc. Name in
Package
<office:document>
Complete office document in a single n/a
XML document.
<office:document-content>
Document content and automatic
content.xml
styles used in the content.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 37 of 706

Root Element
Subdocument Content
Subdoc. Name in
Package
<office:document-styles>
Styles used in the document content
styles.xml
and automatic styles used in the
styles themselves.
<office:document-meta>
Document meta information, such as meta.xml
the author or the time of the last save
action.
<office:document-settings> Application-specific settings, such as settings.xml
the window size or printer information.
The definitions of the root elements described in the table above are analogous to the definition
of <office:document>, except that the child element specification is suitably restricted.
50
<start>
51
<choice>
52
<ref name="office-document"/>
53
<ref name="office-document-content"/>
54
<ref name="office-document-styles"/>
55
<ref name="office-document-meta"/>
56
<ref name="office-document-settings"/>
57
</choice>
58
</start>
2.1.1 Document Root Element Content Models
The content models of the five root elements is summarized in the following table. Note that
<office:document> may contain all supported top-level elements. None of the four
subdocument root elements contain the complete data, but four combined do.
Root Element
meta app. script font
style
auto
mast body
data sett.
decls
style
style
<office:document>








<office:document-content>




<office:document-styles>




<office:document-meta>

<office:document-settings>

The <office:document> root contains a complete document:
59
<define name="office-document">
60
<element name="office:document">
61
<ref name="office-document-attrs"/>
62
<ref name="office-document-common-attrs"/>
63
<ref name="office-meta"/>
64
<ref name="office-settings"/>
65
<ref name="office-scripts"/>
66
<ref name="office-font-face-decls"/>
67
<ref name="office-styles"/>
68
<ref name="office-automatic-styles"/>
69
<ref name="office-master-styles"/>
70
<ref name="office-body"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 38 of 706

71
</element>
72
</define>
The <office:document-content> root contains only the document content, along with the
automatic styles needed for the document content:
73
<define name="office-document-content">
74
<element name="office:document-content">
75
<ref name="office-document-common-attrs"/>
76
<ref name="office-scripts"/>
77
<ref name="office-font-face-decls"/>
78
<ref name="office-automatic-styles"/>
79
<ref name="office-body"/>
80
</element>
81
</define>
The <office:document-styles> root contains all named styles of a document, along with
the automatic styles needed for the named styles:
82
<define name="office-document-styles">
83
<element name="office:document-styles">
84
<ref name="office-document-common-attrs"/>
85
<ref name="office-font-face-decls"/>
86
<ref name="office-styles"/>
87
<ref name="office-automatic-styles"/>
88
<ref name="office-master-styles"/>
89
</element>
90
</define>
The <office:document-meta> root contains the meta information about a document.
91
<define name="office-document-meta">
92
<element name="office:document-meta">
93
<ref name="office-document-common-attrs"/>
94
<ref name="office-meta"/>
95
</element>
96
</define>
The <office:document-settings> root contains application specific settings to be applied
when processing this document.
97
<define name="office-document-settings">
98
<element name="office:document-settings">
99
<ref name="office-document-common-attrs"/>
100
<ref name="office-settings"/>
101
</element>
102
</define>
2.1.2 Document Root Attributes
Version
All root elements take an office:version attribute, which indicates which version of this
specification it complies with. The version number is in the format revision.version. If the
file has a version known to an XML processor, it may validate the document. Otherwise, it's
optional to validate the document, but the document must be well formed.
103
<define name="office-document-common-attrs" combine="interleave">
104
<optional>
105
<attribute name="office:version">
106
<ref name="string"/>
107
</attribute>
108
</optional>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 39 of 706

109
</define>
MIME Type
The <office:document> element takes an office:mimetype attribute, which indicates the
type of document (text, spreadsheet etc.). This attribute is especial y important for flat XML files,
where this is the only way the type of document can be detected (in a package, the MIME type is
also present in a separate file, see section 17.4). Its values are the MIME types that are used for
the packaged variant of office documents (see section 1.7).
110
<define name="office-document-attrs" combine="interleave">
111
<attribute name="office:mimetype">
112
<ref name="string"/>
113
</attribute>
114
</define>
2.2 Document Metadata
Metadata is general information about a document. In the OpenDocument format, all of the
metadata elements are contained in an <office:meta> element, usually located at start of the
document. Metadata elements may be omitted or occur multiple times. It is application-specific
how to update multiple instances of the same elements.
115
<define name="office-meta">
116
<optional>
117
<element name="office:meta">
118
<ref name="office-meta-content"/>
119
</element>
120
</optional>
121
</define>
122
123
<define name="office-meta-content">
124
<ref name="anyElements"/>
125
</define>
126
127
<define name="office-meta-content-strict">
128
<zeroOrMore>
129
<ref name="office-meta-data"/>
130
</zeroOrMore>
131
</define>
2.2.1 Pre-Defined vs. Custom Metadata
In the OpenDocument schema the metadata is comprised of pre-defined metadata elements,
user defined metadata, as well as custom metadata elements. The pre-defined metadata
elements have defined semantics. They SHOULD be processed and updated by editing
applications. They can be referenced from within the document through the use of suitable text
fields.
User-defined metadata is a more generic mechanism which specifies a triplet of name, type, and
value. Supporting applications can present these value to the user, making use of the supplied
data type. The user-defined metadata can be referenced from within the document through the
use of suitable text fields.
Custom metadata are arbitrary elements inside <office:meta>. Since their semantics is not
defined in this specification, conforming applications in general cannot process or display this
data. Applications SHOULD preserve this data when editing the document.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 40 of 706

2.2.2 Sample Metadata
Example: Sample metadata of a document in OpenDocument format
<office:meta>
<dc:title>Title of the document</dc:title>
<dc:description>Description/Comment for the document</dc:description>
<meta:initial-creator>User Name</meta:initial-creator>
<meta:creation-date>1999-10-18T12:34:56</meta:creation-date>
<dc:creator>User Name</dc:creator>
<dc:date>1999-10-19T15:16:17</dc:date>
<meta:printed-by>User Name</meta:printed-by>
<meta:print-date>1999-10-20T16:17:18</meta:print-date>
<dc:subject>Description of the document</dc:subject>
<meta:editing-duration>PT5H10M10S</meta:editing-duration>
<meta:keyword>First keyword</meta:keyword>
<meta:keyword>Second keyword</meta:keyword>
<meta:keyword>Third keyword</meta:keyword>
<meta:template xlink:type="simple"
xlink:href="file:///c|/
office52/share/template/german/finance/budget.vor"
xlink:title="Template name"
meta:date="1999-10-15T10:11:12" />
<meta:auto-reload
xlink:type="simple"
xlink:href="file:///..."
meta:delay="P60S" />
<dc:language>de-DE</dc:language>
<meta:user-defined meta:name="Field 1"
meta:type="string">Value 1</meta:user-defined>
<meta:user-defined meta:name="Field 2"
meta:type="float">1.234</meta:user-defined>
</office:meta>
2.3 Body Element and Document Types
The document body contains an element to indicate which type of content this document
contains. Currently supported document types are:
• text documents
• drawing documents
• presentation documents
• spreadsheet documents
• chart documents
• image documents
All document types share the same content elements, but different document types place
different restrictions on which elements may occur, and in what combinations. The document
content is typically framed by a prelude and epilogue, which contain additional information for a
specific type of document, like form data or variable declarations.
132
<define name="office-body">
133
<element name="office:body">
134
<ref name="office-body-content"/>
135
</element>
136
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 41 of 706

2.3.1 Text Documents
The content of text documents mainly consists of a sequence containing any number of
paragraphs, tables, indices, text frames, text sections, and graphical elements. Additionally, a
text document may contain forms, change tracking information and variable declarations. Each
of these is defined in the document prelude, and may be referenced from the document content.
137
<define name="office-body-content" combine="choice">
138
<element name="office:text">
139
<ref name="office-text-attlist"/>
140
<ref name="office-text-content-prelude"/>
141
<zeroOrMore>
142
<ref name="office-text-content-main"/>
143
</zeroOrMore>
144
<ref name="office-text-content-epilogue"/>
145
</element>
146
</define>
Text Document Content Model
The text document prelude contains the document's form data, change tracking information, and
variable declarations. To allow office applications to implement functionality that usually is
available in spreadsheets for text documents, it may also contain elements that implement
enhanced table features. See also section 2.3.4.
147
<define name="office-text-content-prelude">
148
<ref name="office-forms"/>
149
<ref name="text-tracked-changes"/>
150
<ref name="text-decls"/>
151
<ref name="table-decls"/>
152
</define>
The main document content contains any sequence of text content elements, which includes
paragraphs (and headings), text sections (and indices), tables, and graphical shapes. As an
alternative, a text document may contain of a single page sequence.
It is not required that a text document contains a paragraph. A text document may consist of a
sequence frames only.
153
<define name="office-text-content-main">
154
<choice>
155
<zeroOrMore>
156
<ref name="text-content"/>
157
</zeroOrMore>
158
<group>
159
<ref name="text-page-sequence"/>
160
<zeroOrMore>
161
<choice>
162
<ref name="draw-a"/>
163
<ref name="shape"/>
164
</choice>
165
</zeroOrMore>
166
</group>
167
</choice>
168
</define>
169
170
<define name="text-content">
171
<choice>
172
<ref name="text-h"/>
173
<ref name="text-p"/>
174
<ref name="text-list"/>
175
<ref name="text-numbered-paragraph"/>
176
<ref name="table-table"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 42 of 706

177
<ref name="draw-a"/>
178
<ref name="text-section"/>
179
<ref name="text-table-of-content"/>
180
<ref name="text-illustration-index"/>
181
<ref name="text-table-index"/>
182
<ref name="text-object-index"/>
183
<ref name="text-user-index"/>
184
<ref name="text-alphabetical-index"/>
185
<ref name="text-bibliography"/>
186
<ref name="shape"/>
187
<ref name="change-marks"/>
188
</choice>
189
</define>
There are no text documents specific epilogue elements, but the epilogue may contain elements
that implement enhanced table features. See also section 2.3.4.
190
<define name="office-text-content-epilogue">
191
<ref name="table-functions"/>
192
</define>
Global Text Documents
There is a common use case for large documents to be edited in separate entities, such that
there is a 'global' document, containing several linked constituent subdocuments. This can be
implemented by using linked text sections (see section 4.4). To facilitate an editing application
adapting the user interface to better support the notion of 'global' document with constituent parts
(as opposed to a document with arbitrary linked content), the text:global flag can be used. If
set to true, it informs applications that linked sections in this document have part-of semantics.
The actual XML representation of the sections does not change.
193
<define name="office-text-attlist" combine="interleave">
194
<optional>
195
<attribute name="text:global" a:defaultValue="false">
196
<ref name="boolean"/>
197
</attribute>
198
</optional>
199
</define>
2.3.2 Drawing Documents
The content of drawing document consists of a sequence of draw pages.
200
<define name="office-body-content" combine="choice">
201
<element name="office:drawing">
202
<ref name="office-drawing-attlist"/>
203
<ref name="office-drawing-content-prelude"/>
204
<ref name="office-drawing-content-main"/>
205
<ref name="office-drawing-content-epilogue"/>
206
</element>
207
</define>
208
209
<define name="office-drawing-attlist">
210
<empty/>
211
</define>
Drawing Document Content Model
The drawing document prelude may contain text declarations only. To allow office applications to
implement functionality that usually is available in spreadsheets for drawing documents, it may
also contain elements that implement enhanced table features. See also section 2.3.4.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 43 of 706

212
<define name="office-drawing-content-prelude">
213
<ref name="text-decls"/>
214
<ref name="table-decls"/>
215
</define>
The main document content contains a sequence of draw pages.
216
<define name="office-drawing-content-main">
217
<zeroOrMore>
218
<ref name="draw-page"/>
219
</zeroOrMore>
220
</define>
There are no drawing documents specific epilogue elements, but the epilogue may contain
elements that implement enhanced table features. See also section 2.3.4.
221
<define name="office-drawing-content-epilogue">
222
<ref name="table-functions"/>
223
</define>
2.3.3 Presentation Documents
The content of presentation document consists of a sequence of draw pages.
224
<define name="office-body-content" combine="choice">
225
<element name="office:presentation">
226
<ref name="office-presentation-attlist"/>
227
<ref name="office-presentation-content-prelude"/>
228
<ref name="office-presentation-content-main"/>
229
<ref name="office-presentation-content-epilogue"/>
230
</element>
231
</define>
232
233
<define name="office-presentation-attlist">
234
<empty/>
235
</define>
Presentation Document Content Model
The presentation document prelude equals the one of a drawing document, but may contain
some additional declarations. See also section 2.3.2.
236
<define name="office-presentation-content-prelude">
237
<ref name="text-decls"/>
238
<ref name="table-decls"/>
239
<ref name="presentation-decls"/>
240
</define>
The main document content contains a sequence of draw pages.
241
<define name="office-presentation-content-main">
242
<zeroOrMore>
243
<ref name="draw-page"/>
244
</zeroOrMore>
245
</define>
The epilogue of presentation documents may contain presentation settings. Additionally, it may
contain elements that implement enhanced table features. See also section 2.3.4.
246
<define name="office-presentation-content-epilogue">
247
<ref name="presentation-settings"/>
248
<ref name="table-functions"/>
249
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 44 of 706

2.3.4 Spreadsheet Documents
The content of spreadsheet documents mainly consists of a sequence of tables. Additionally, a
spreadsheet document may contain forms, change tracking information and various kinds of
declarations that simplify the usage of spreadsheet tables and their analysis. Each of these are
contained in either the document prelude, or the document epilogue.
250
<define name="office-body-content" combine="choice">
251
<element name="office:spreadsheet">
252
<ref name="office-spreadsheet-attlist"/>
253
<ref name="office-spreadsheet-content-prelude"/>
254
<ref name="office-spreadsheet-content-main"/>
255
<ref name="office-spreadsheet-content-epilogue"/>
256
</element>
257
</define>
Spreadsheet Document Content Model
The spreadsheet document prelude contains the document's form data, change tracking
information, calculation setting for formulas, validation rules for cell content and declarations for
label ranges.
258
<define name="office-spreadsheet-content-prelude">
259
<optional>
260
<ref name="table-tracked-changes"/>
261
</optional>
262
<ref name="text-decls"/>
263
<ref name="table-decls"/>
264
</define>
265
266
<define name="table-decls">
267
<optional>
268
<ref name="table-calculation-settings"/>
269
</optional>
270
<optional>
271
<ref name="table-content-validations"/>
272
</optional>
273
<optional>
274
<ref name="table-label-ranges"/>
275
</optional>
276
</define>
The main document is a list of tables.
277
<define name="office-spreadsheet-content-main">
278
<zeroOrMore>
279
<ref name="table-table"/>
280
</zeroOrMore>
281
</define>
The epilogue of spreadsheet documents contains declarations for named expressions, database
ranges, data pilot tables, consolidation operations and DDE links.
282
<define name="office-spreadsheet-content-epilogue">
283
<ref name="table-functions"/>
284
</define>
285
286
<define name="table-functions">
287
<optional>
288
<ref name="table-named-expressions"/>
289
</optional>
290
<optional>
291
<ref name="table-database-ranges"/>
292
</optional>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 45 of 706

293
<optional>
294
<ref name="table-data-pilot-tables"/>
295
</optional>
296
<optional>
297
<ref name="table-consolidation"/>
298
</optional>
299
<optional>
300
<ref name="table-dde-links"/>
301
</optional>
302
</define>
2.3.5 Chart Documents
The content of chart documents mainly consists of a chart element.
303
<define name="office-body-content" combine="choice">
304
<element name="office:chart">
305
<ref name="office-chart-attlist"/>
306
<ref name="office-chart-content-prelude"/>
307
<ref name="office-chart-content-main"/>
308
<ref name="office-chart-content-epilogue"/>
309
</element>
310
</define>
311
312
<define name="office-chart-attlist">
313
<empty/>
314
</define>
Chart Document Content Model
To allow office applications to implement functionality that usually is available in spreadsheets
for the table that may be contained in a chart, the chart document prelude may contain elements
that implement enhanced table features. See also section 2.3.4.
315
<define name="office-chart-content-prelude">
316
<ref name="text-decls"/>
317
<ref name="table-decls"/>
318
</define>
The main document is a chart element only.
319
<define name="office-chart-content-main">
320
<ref name="chart-chart"/>
321
</define>
There are no chart documents specific epilogue elements, but the epilogue may contain
elements that implement enhanced table features. See also section 2.3.4.
322
<define name="office-chart-content-epilogue">
323
<ref name="table-functions"/>
324
</define>
2.3.6 Image Documents
The content of an image document is a frame element only. The frame element must contain a
single image element.
325
<define name="office-body-content" combine="choice">
326
<element name="office:image">
327
<ref name="office-image-attlist"/>
328
<ref name="office-image-content-prelude"/>
329
<ref name="office-image-content-main"/>
330
<ref name="office-image-content-epilogue"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 46 of 706

331
</element>
332
</define>
333
334
<define name="office-image-attlist">
335
<empty/>
336
</define>
Image Document Content Model
The image document prelude is empty.
337
<define name="office-image-content-prelude">
338
<empty/>
339
</define>
The main document content contains a frame only.
340
<define name="office-image-content-main">
341
<ref name="draw-frame"/>
342
</define>
There are no image documents specific epilogue elements.
343
<define name="office-image-content-epilogue">
344
<empty/>
345
</define>
2.4 Application Settings
Application settings are contained in a <office:settings> element.
346
<define name="office-settings">
347
<optional>
348
<element name="office:settings">
349
<oneOrMore>
350
<ref name="config-config-item-set"/>
351
</oneOrMore>
352
</element>
353
</optional>
354
</define>
The settings for office applications may be divided into several categories each represented by a
<config:config-item-set> element. For instance the following two categories may exist:

Document settings, for example default printer.

View settings, for example zoom level.
2.4.1 Sequence of Settings
The <config:config-item-set> element is a container element for all types of setting
elements. The settings can be contained in the element is any order.
355
<define name="config-config-item-set">
356
<element name="config:config-item-set">
357
<ref name="config-config-item-set-attlist"/>
358
<ref name="config-items"/>
359
</element>
360
</define>
361
362
<define name="config-items">
363
<oneOrMore>
364
<choice>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 47 of 706

365
<ref name="config-config-item"/>
366
<ref name="config-config-item-set"/>
367
<ref name="config-config-item-map-named"/>
368
<ref name="config-config-item-map-indexed"/>
369
</choice>
370
</oneOrMore>
371
</define>
Config Name
The config:name attribute identifies the name of the setting container. For top level
<config:config-item-set> elements, that are elements that are direct children of the
<office:settings> element, the name should be preceded by a namespace prefix that
identifies the application the settings belong to.
372
<define name="config-config-item-set-attlist" combine="interleave">
373
<attribute name="config:name">
374
<ref name="string"/>
375
</attribute>
376
</define>
Example:
<office:settings>
<config:config-item-set xmlns:ooo="http://www.openoffice.org/...";
config:name="ooo:view-settings">
<config:config-item config:name="ViewAreaTop"
config:type="int">0</config:config-item>
</config:config-item-set>
</office:settings>
2.4.2 Base Settings
The <config:config-item> element contains all base settings. The value of the setting is
stored in the element.
377
<define name="config-config-item">
378
<element name="config:config-item">
379
<ref name="config-config-item-attlist"/>
380
<text/>
381
</element>
382
</define>
Config Name
The config:name attribute identifies the name of the setting.
383
<define name="config-config-item-attlist" combine="interleave">
384
<attribute name="config:name">
385
<ref name="string"/>
386
</attribute>
387
</define>
Config Type
The config:type attribute identifies the data type of setting.
388
<define name="config-config-item-attlist" combine="interleave">
389
<attribute name="config:type">
390
<choice>
391
<value>boolean</value>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 48 of 706

392
<value>short</value>
393
<value>int</value>
394
<value>long</value>
395
<value>double</value>
396
<value>string</value>
397
<value>datetime</value>
398
<value>base64Binary</value>
399
</choice>
400
</attribute>
401
</define>
2.4.3 Index Access of Sequences
The <config:config-item-map-indexed> element is a container element for sequences.
The order specifies the index of the elements
402
<define name="config-config-item-map-indexed">
403
<element name="config:config-item-map-indexed">
404
<ref name="config-config-item-map-indexed-attlist"/>
405
<oneOrMore>
406
<ref name="config-config-item-map-entry"/>
407
</oneOrMore>
408
</element>
409
</define>
Config Name
The config:name attribute identifies the name of the setting sequence.
410
<define name="config-config-item-map-indexed-attlist" combine="interleave">
411
<attribute name="config:name">
412
<ref name="string"/>
413
</attribute>
414
</define>
2.4.4 Map Entry
The <config:config-item-map-entry> element represents an entry in an indexed or
named settings sequence. It is a container element for all types of setting elements.
415
<define name="config-config-item-map-entry">
416
<element name="config:config-item-map-entry">
417
<ref name="config-config-item-map-entry-attlist"/>
418
<ref name="config-items"/>
419
</element>
420
</define>
Config Name
The config:name attribute identifies the name of the setting sequence.
421
<define name="config-config-item-map-entry-attlist" combine="interleave">
422
<optional>
423
<attribute name="config:name">
424
<ref name="string"/>
425
</attribute>
426
</optional>
427
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 49 of 706

2.4.5 Name Access of Sequences
The <config:config-item-map-named> element is a container element for sequences,
where each setting in the sequence is identified by its name.
428
<define name="config-config-item-map-named">
429
<element name="config:config-item-map-named">
430
<ref name="config-config-item-map-named-attlist"/>
431
<oneOrMore>
432
<ref name="config-config-item-map-entry"/>
433
</oneOrMore>
434
</element>
435
</define>
Config Name
The config:name attribute identifies the name of the setting sequence.
436
<define name="config-config-item-map-named-attlist" combine="interleave">
437
<attribute name="config:name">
438
<ref name="string"/>
439
</attribute>
440
</define>
2.4.6 Cursor Position Setting
A common view setting for editing applications is the position where the text cursor was while
saving the document. For WYSIWYG applications, this usually will be a position within a
paragraph only. For applications that provide an XML based view of the document, the cursor
position could be also between arbitrary elements, or even within tags.
To represent a text cursor position within a document, a processing instruction with PITarget
opendocument (see §2.6 of [XML1.0]) SHOULD be used. The name of the cursor position
processing instruction, cursor-position, MUST fol ow the PITarget opendocument. The
processing instruction may have arbitrary application specific attributes, for instance to connect
the cursor position with a certain view of the document, where the views themselves are
specified as application specific settings. The syntax for these attributes MUST be the same as
for attributes within XML start tags.
Where a text cursor position is not sufficient to recreate a document view, applications may use
arbitrary document specific settings in addition to the cursor position processing instruction. They
may also use arbitrary document specific settings if the cursor position is not a text cursor
position, but for instance a selection of drawing objects.
Example: cursor position processing instruction
<text:p>This is<?opendocument cursor-position view-id="view1"?> an
example.</text:p>
2.5 Scripts
A document may contain several scripts in different scripting languages. Each script is
represented by a <office:script> element. All these script elements are contained in a
single <office:scripts> element.
Scripts do not imply a scripting language or an object model. A script can operate on the
Document Object Model (DOM) of a document in OpenDocument format or on an application
specific API.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 50 of 706

Scripts cannot modify a document while the document is loading. However, some events are
called immediately after the document is loaded.
In addition to <office:script> elements, the <office:scripts> element may also contain
an <office:event-listeners> element which contains the events assigned to the
document itself. Examples for these are events called when the document is opened or closed.
See section 12.4 for more information on the <office:event-listeners> element.
441
<define name="office-scripts">
442
<optional>
443
<element name="office:scripts">
444
<zeroOrMore>
445
<ref name="office-script"/>
446
</zeroOrMore>
447
<optional>
448
<ref name="office-event-listeners"/>
449
</optional>
450
</element>
451
</optional>
452
</define>
2.5.1 Script
The <office:script> element contains script language specific content. In most situations,
the element contains the source code of the script, but it may also contain a compiled version of
the script or a link to some external script code.
453
<define name="office-script">
454
<element name="office:script">
455
<ref name="office-script-attlist"/>
456
<mixed>
457
<ref name="anyElements"/>
458
</mixed>
459
</element>
460
</define>
Script Language
The attribute script:language specifies the language of the script by its name. Since script
language names are application specific, the name should be preceded by a namespace prefix.
461
<define name="office-script-attlist">
462
<attribute name="script:language">
463
<ref name="string"/>
464
</attribute>
465
</define>
2.6 Font Face Declarations
A document in OpenDocument format may contain font face declarations. A font face
declaration provides information about the fonts used by the author of a document, so that these
fonts or fonts that are very close to these fonts may be located on other systems. See section
14.6 for details.
466
<define name="office-font-face-decls">
467
<optional>
468
<element name="office:font-face-decls">
469
<zeroOrMore>
470
<ref name="style-font-face"/>
471
</zeroOrMore>
472
</element>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 51 of 706

473
</optional>
474
</define>
2.7 Styles
The OpenDocument format supports the following types of styles:

Common styles
Most office applications support styles within their user interface. Within this specification,
the XML representations of such styles are referred to as styles. When a differentiation from
the other types of styles is required, they are referred to as common styles. The term
common indicates that this is the type of style that an office application user considers to be
a style.

Automatic styles
An automatic style contains formatting properties that, in the user interface view of a
document, are assigned to an object such as a paragraph. The term automatic indicates that
the style is generated automatically. In other words, formatting properties that are
immediately assigned to a specific object are represented by an automatic style. This way, a
separation of content and layout is achieved.

Master styles
A master style is a common style that contains formatting information and additional content
that is displayed with the document content when the style is applied. An example of a
master style are master pages. Master pages can be used in graphical applications. In this
case, the additional content is any drawing shapes that are displayed as the background of
the draw page. Master pages can also be used in text documents. In this case, the additional
content is the headers and footers. Please note that the content that is contained within
master styles is additional content that influences the representation of a document but does
not change the content of a document.
As far as the office application user is concerned, all types of styles are part of the document.
They represent the output device-independent layout and formatting information that the author
of a document has used to create or edit the document. The assumption is that the author of the
document wants this formatting and layout information to be preserved when the document is
reloaded or displayed on any device, because this is common practice for documents created by
word processors.
This type of style information differs from [CSS2] or [XSLT] style sheets that are used to display
a document. An additional style sheet for CSS, XSLT, and so on, is required to display an
document in OpenDocument format on a certain device. This style sheet must take into account
the styles in the document as well as the requirements and capabilities of the output device. The
ideal case is that this style sheet depends on the output device only.
See section 14 for more information on styles.
2.7.1 Location of Styles
Common and automatic styles have the same XML representation, but they are contained within
two distinct container elements, as follows:

<office:styles> for common styles

<office:automatic-styles> for automatic styles

Master styles are contained within a container element of its own:

<office:master-styles>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 52 of 706

475
<define name="office-styles">
476
<optional>
477
<element name="office:styles">
478
<interleave>
479
<ref name="styles"/>
480
<zeroOrMore>
481
<ref name="style-default-style"/>
482
</zeroOrMore>
483
<optional>
484
<ref name="text-outline-style"/>
485
</optional>
486
<zeroOrMore>
487
<ref name="text-notes-configuration"/>
488
</zeroOrMore>
489
<optional>
490
<ref name="text-bibliography-configuration"/>
491
</optional>
492
<optional>
493
<ref name="text-linenumbering-configuration"/>
494
</optional>
495
<zeroOrMore>
496
<ref name="draw-gradient"/>
497
</zeroOrMore>
498
<zeroOrMore>
499
<ref name="svg-linearGradient"/>
500
</zeroOrMore>
501
<zeroOrMore>
502
<ref name="svg-radialGradient"/>
503
</zeroOrMore>
504
<zeroOrMore>
505
<ref name="draw-hatch"/>
506
</zeroOrMore>
507
<zeroOrMore>
508
<ref name="draw-fill-image"/>
509
</zeroOrMore>
510
<zeroOrMore>
511
<ref name="draw-marker"/>
512
</zeroOrMore>
513
<zeroOrMore>
514
<ref name="draw-stroke-dash"/>
515
</zeroOrMore>
516
<zeroOrMore>
517
<ref name="draw-opacity"/>
518
</zeroOrMore>
519
<zeroOrMore>
520
<ref name="style-presentation-page-layout"/>
521
</zeroOrMore>
522
</interleave>
523
</element>
524
</optional>
525
</define>
526
<define name="office-automatic-styles">
527
<optional>
528
<element name="office:automatic-styles">
529
<interleave>
530
<ref name="styles"/>
531
<zeroOrMore>
532
<ref name="style-page-layout"/>
533
</zeroOrMore>
534
</interleave>
535
</element>
536
</optional>
537
</define>
538
<define name="office-master-styles">
539
<optional>
540
<element name="office:master-styles">
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 53 of 706

541
<interleave>
542
<zeroOrMore>
543
<ref name="style-master-page"/>
544
</zeroOrMore>
545
<optional>
546
<ref name="style-handout-master"/>
547
</optional>
548
<optional>
549
<ref name="draw-layer-set"/>
550
</optional>
551
</interleave>
552
</element>
553
</optional>
554
</define>
555
556
<define name="styles">
557
<interleave>
558
<zeroOrMore>
559
<ref name="style-style"/>
560
</zeroOrMore>
561
<zeroOrMore>
562
<ref name="text-list-style"/>
563
</zeroOrMore>
564
<zeroOrMore>
565
<ref name="number-number-style"/>
566
</zeroOrMore>
567
<zeroOrMore>
568
<ref name="number-currency-style"/>
569
</zeroOrMore>
570
<zeroOrMore>
571
<ref name="number-percentage-style"/>
572
</zeroOrMore>
573
<zeroOrMore>
574
<ref name="number-date-style"/>
575
</zeroOrMore>
576
<zeroOrMore>
577
<ref name="number-time-style"/>
578
</zeroOrMore>
579
<zeroOrMore>
580
<ref name="number-boolean-style"/>
581
</zeroOrMore>
582
<zeroOrMore>
583
<ref name="number-text-style"/>
584
</zeroOrMore>
585
</interleave>
586
</define>
The following examples illustrate the different types of OpenDocument styles.
Example: OpenDocument styles
<office:document ...>
<office:styles>
...
</office:styles>
<office:automatic-styles>
...
</office:automatic-styles>
<office:master-styles>
...
</office:master-styles>
</office:document>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 54 of 706

2.8 Page Styles and Layout
The style and layout of the pages in a document is determined by:

Page Layouts

Master Pages
A page layout describes the physical properties or geometry of a page, for example, page size,
margins, header height, and footer height.
A master page is a template for pages in a document. It contains a reference to a page layout
which specifies the physical properties of the page and can also contain static content that is
displayed on all pages in the document that use the master page. Examples of static content are
headers, footers, or background graphics.
If a text or spreadsheet document is displayed in a paged layout, the master pages are
instantiated to generate a sequence of pages containing the document content. When a master
page is instantiated, an empty page is generated with the properties of the page master and the
static content of the master page. The body of the page is then filled with content. If multiple
pages in a document use the same master page, the master page can be instantiated several
times within the document.
In text and spreadsheet documents, a master page can be assigned to paragraph and table
styles using a style:master-page-name attribute. Each time the paragraph or table style is
applied to text, a page break is inserted before the paragraph or table. The page that starts at the
page break position uses the specified master page.
In drawings and presentations, master pages can be assigned to drawing pages using a
style:parent-style-name attribute.
Note: The OpenDocument paging methodology differs significantly from the methodology used
in [XSL]. In XSL, headers and footers are contained within page sequences that also contain the
document content. In the OpenDocument format, headers and footers are contained in page
styles. With either approach, the content of headers and footers can be changed or omitted
without affecting the document content.
Page layouts are described in section 14.3. Master pages are described in section 14.4.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 55 of 706

3 Meta Data Elements
The metadata elements borrow heavily upon the metadata standards developed by the Dublin
Core Metadata Initiative (http://www.dublincore.org). Metadata elements drawn directly from the
Dublin Core work use its namespace prefix (see section 1.3).
3.1 Pre-Defined Metadata Elements
There is a set of pre-defined metadata elements which should be processed and updated by the
applications. Metadata elements may be omitted or occur multiple times. It is application-specific
how to update multiple instances of the same elements.
3.1.1 Generator
The <meta:generator> element contains a string that identifies the application or tool that
was used to create or last modify the XML document. This string SHOULD match the definition
for user-agents in the HTTP protocol a specified in section 14.43 of [RFC2616]. The generator
string SHOULD allow product versions to differ between all released versions of a user agent, for
instance by including build ids or patch level information.
Conforming applications MAY use the generator string to work around bugs that exist or existed
in certain applications, but MUST NOT deliberately implement a different behavior depending on
a certain generator string.
If the application that created the document could not provide an identifier string, the application
does not export this element. If another application modifies the document and it cannot provide
a unique identifier, it MUST NOT export the original identifier belonging to the application that
created the document.
587
<define name="office-meta-data" combine="choice">
588
<element name="meta:generator">
589
<ref name="string"/>
590
</element>
591
</define>
3.1.2 Title
The <dc:title> element specifies the title of the document.
592
<define name="office-meta-data" combine="choice">
593
<element name="dc:title">
594
<ref name="string"/>
595
</element>
596
</define>
3.1.3 Description
The <dc:description> element contains a brief description of the document.
597
<define name="office-meta-data" combine="choice">
598
<element name="dc:description">
599
<ref name="string"/>
600
</element>
601
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 56 of 706

3.1.4 Subject
The <dc:subject> element specifies the subject of the document.
602
<define name="office-meta-data" combine="choice">
603
<element name="dc:subject">
604
<ref name="string"/>
605
</element>
606
</define>
3.1.5 Keywords
The <meta:keyword> element contains a keyword pertaining to the document. The metadata
can contain any number of <meta:keyword> elements, each element specifying one keyword.
607
<define name="office-meta-data" combine="choice">
608
<element name="meta:keyword">
609
<ref name="string"/>
610
</element>
611
</define>
3.1.6 Initial Creator
The <meta:initial-creator> element specifies the name of the person who created the
document initial y.
612
<define name="office-meta-data" combine="choice">
613
<element name="meta:initial-creator">
614
<ref name="string"/>
615
</element>
616
</define>
3.1.7 Creator
The <dc:creator> element specifies the name of the person who last modified the document.
The name of this element was chosen for compatibility with the Dublin Core, but this definition of
"creator" used here differs from Dublin Core, which defines creator as "An entity primarily
responsible for making the content of the resource." In OpenDocument terminology, the last
person to modify the document is primarily responsible for making the content of the document.
617
<define name="office-meta-data" combine="choice">
618
<ref name="dc-creator"/>
619
</define>
620
<define name="dc-creator">
621
<element name="dc:creator">
622
<ref name="string"/>
623
</element>
624
</define>
3.1.8 Printed By
The <meta:printed-by> element specifies the name of the last person who printed the
document.
625
<define name="office-meta-data" combine="choice">
626
<element name="meta:printed-by">
627
<ref name="string"/>
628
</element>
629
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 57 of 706

3.1.9 Creation Date and Time
The <meta:creation-date> element specifies the date and time when the document was
created initially.
To conform with [xmlschema-2], the date and time format is YYYY-MM-DDThh:mm:ss.
630
<define name="office-meta-data" combine="choice">
631
<element name="meta:creation-date">
632
<ref name="dateTime"/>
633
</element>
634
</define>
3.1.10 Modification Date and Time
The <dc:date> element specifies the date and time when the document was last modified.
To conform with [xmlschema-2], the date and time format is YYYY-MM-DDThh:mm:ss.
The name of this element was chosen for compatibility with the Dublin Core.
635
<define name="office-meta-data" combine="choice">
636
<ref name="dc-date"/>
637
</define>
638
<define name="dc-date">
639
<element name="dc:date">
640
<ref name="dateTime"/>
641
</element>
642
</define>
3.1.11 Print Date and Time
The <meta:print-date> element specifies the date and time when the document was last
printed.
To conform with [xmlschema-2], the date and time format is YYYY-MM-DDThh:mm:ss.
643
<define name="office-meta-data" combine="choice">
644
<element name="meta:print-date">
645
<ref name="dateTime"/>
646
</element>
647
</define>
3.1.12 Document Template
The <meta:template> element contains a URL for the document template that was used to
create the document. The URL is specified as an XLink.
This element conforms to the XLink Specification. See [XLink].
The attributes that may be associated with the <meta:template> element are:

Template location

Template title

Template modification date and time
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 58 of 706

Template Location
An xlink:href attribute specifies the location of the document template.
Template Title
The xlink:title attribute specifies the name of the document template.
Template Modification Date and Time
The meta:date attribute specifies the date and time when the template was last modified, prior
to being used to create the current document.
To conform with [xmlschema-2], the date and time format is YYYY-MM-DDThh:mm:ss.
648
<define name="office-meta-data" combine="choice">
649
<element name="meta:template">
650
<attribute name="xlink:href">
651
<ref name="anyURI"/>
652
</attribute>
653
<optional>
654
<attribute name="xlink:type" a:defaultValue="simple">
655
<value>simple</value>
656
</attribute>
657
</optional>
658
<optional>
659
<attribute name="xlink:actuate" a:defaultValue="onRequest">
660
<value>onRequest</value>
661
</attribute>
662
</optional>
663
<optional>
664
<attribute name="xlink:title">
665
<ref name="string"/>
666
</attribute>
667
</optional>
668
<optional>
669
<attribute name="meta:date">
670
<ref name="dateTime"/>
671
</attribute>
672
</optional>
673
</element>
674
</define>
3.1.13 Automatic Reload
The <meta:auto-reload> element specifies whether a document is reloaded or replaced by
another document after a certain period of time has elapsed.
The attributes that may be associated with the <meta:auto-reload> element are:

Reload URL

Reload delay
Reload URL
If a loaded document should be replaced by another document after a certain period of time, the
<meta:auto-reload> element is presented as an XLink. An xlink:href attribute identifies
the URL of the replacement document.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 59 of 706

Reload Delay
The meta:delay attribute specifies the reload delay.
To conform with the duration data type of [xmlschema-2], the format of the value of this attribute
is PnYnMnDTnHnMnS. See §3.2.6 of [xmlschema-2] for more detailed information on this
duration format.
675
<define name="office-meta-data" combine="choice">
676
<element name="meta:auto-reload">
677
<optional>
678
<attribute name="xlink:type" a:defaultValue="simple">
679
<value>simple</value>
680
</attribute>
681
</optional>
682
<optional>
683
<attribute name="xlink:show" a:defaultValue="replace">
684
<value>replace</value>
685
</attribute>
686
</optional>
687
<optional>
688
<attribute name="xlink:actuate" a:defaultValue="onLoad">
689
<value>onLoad</value>
690
</attribute>
691
</optional>
692
<optional>
693
<attribute name="xlink:href">
694
<ref name="anyURI"/>
695
</attribute>
696
</optional>
697
<optional>
698
<attribute name="meta:delay">
699
<ref name="duration"/>
700
</attribute>
701
</optional>
702
</element>
703
</define>
3.1.14 Hyperlink Behavior
The <meta:hyperlink-behaviour> element specifies the default behavior for hyperlinks in
the document.
The only attribute that may be associated with the <meta:hyperlink-behaviour> element
is:

Target frame
Target Frame
The meta:target-frame-name attribute specifies the name of the default target frame in
which to display a document referenced by a hyperlink.
This attribute can have one of the following values:

_self : The referenced document replaces the content of the current frame.

_blank : The referenced document is displayed in a new frame.

_parent : The referenced document is displayed in the parent frame of the current frame.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 60 of 706


_top : The referenced document is displayed in the topmost frame, that is the frame that
contains the current frame as a child or descendent but is not contained within another
frame.

A frame name : The referenced document is displayed in the named frame. If the named
frame does not exist, a new frame with that name is created.
To conform with the XLink Specification, an additional xlink:show attribute is attached to the
<meta:hyperlink-behaviour> element. If the value of the meta:target-frame-name
attribute is _blank, the xlink:show attribute value is new. If the value of the meta:target-
frame-name attribute is any of the other value options, the value of the xlink:show attribute
is replace.
704
<define name="office-meta-data" combine="choice">
705
<element name="meta:hyperlink-behaviour">
706
<optional>
707
<attribute name="office:target-frame-name">
708
<ref name="targetFrameName"/>
709
</attribute>
710
</optional>
711
<optional>
712
<attribute name="xlink:show">
713
<choice>
714
<value>new</value>
715
<value>replace</value>
716
</choice>
717
</attribute>
718
</optional>
719
</element>
720
</define>
3.1.15 Language
The <dc:language> element specifies the default language of the document.
The manner in which the language is represented is similar to the language tag described in
[RFC3066]. It consists of a two or three letter Language Code taken from the ISO 639 standard
optionally followed by a hyphen (-) and a two-letter Country Code taken from the ISO 3166
standard.
721
<define name="office-meta-data" combine="choice">
722
<element name="dc:language">
723
<ref name="language"/>
724
</element>
725
</define>
3.1.16 Editing Cycles
The <meta:editing-cycles> element specifies the number of editing cycles the document
has been through.
The value of this element is incremented every time the document is saved. The element
contains the number of editing cycles as text.
726
<define name="office-meta-data" combine="choice">
727
<element name="meta:editing-cycles">
728
<ref name="nonNegativeInteger"/>
729
</element>
730
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 61 of 706

3.1.17 Editing Duration
The <meta:editing-duration> element specifies the total time spent editing the document.
The duration is represented in the duration data type of [xmlschema-2], that is
PnYnMnDTnHnMnS. See §3.2.6 of [xmlschema-2] for more detailed information on this duration
format.
731
<define name="office-meta-data" combine="choice">
732
<element name="meta:editing-duration">
733
<ref name="duration"/>
734
</element>
735
</define>
3.1.18 Document Statistics
The <meta:document-statistic> element specifies the statistics of the document, for
example, the page count, word count, and so on. The statistics are specified as attributes of the
<meta:document-statistic> element and the statistics that are exported with the document
depend on the document type and the application used to create the document.
Document
Document Statistics Attributes
Type
Text
meta:page-count
meta:table-count
meta:draw-count
meta:image-count
meta:ole-object-count
meta:paragraph-count
meta:word-count
meta:character-count
meta:row-count
meta:frame-count
meta:sentence-count
meta:syllable-count
meta:non-whitespace-character-count
Spreadsheet
meta:page-count
meta:table-count
meta:image-count
meta:cell-count
meta:object-count
Graphic
meta:page-count
meta:image-count
meta:object-count
736
<define name="office-meta-data" combine="choice">
737
<element name="meta:document-statistic">
738
<optional>
739
<attribute name="meta:page-count">
740
<ref name="nonNegativeInteger"/>
741
</attribute>
742
</optional>
743
<optional>
744
<attribute name="meta:table-count">
745
<ref name="nonNegativeInteger"/>
746
</attribute>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 62 of 706

747
</optional>
748
<optional>
749
<attribute name="meta:draw-count">
750
<ref name="nonNegativeInteger"/>
751
</attribute>
752
</optional>
753
<optional>
754
<attribute name="meta:image-count">
755
<ref name="nonNegativeInteger"/>
756
</attribute>
757
</optional>
758
<optional>
759
<attribute name="meta:ole-object-count">
760
<ref name="nonNegativeInteger"/>
761
</attribute>
762
</optional>
763
<optional>
764
<attribute name="meta:paragraph-count">
765
<ref name="nonNegativeInteger"/>
766
</attribute>
767
</optional>
768
<optional>
769
<attribute name="meta:word-count">
770
<ref name="nonNegativeInteger"/>
771
</attribute>
772
</optional>
773
<optional>
774
<attribute name="meta:character-count">
775
<ref name="nonNegativeInteger"/>
776
</attribute>
777
</optional>
778
<optional>
779
<attribute name="frame-count">
780
<ref name="nonNegativeInteger"/>
781
</attribute>
782
</optional>
783
<optional>
784
<attribute name="sentence-count">
785
<ref name="nonNegativeInteger"/>
786
</attribute>
787
</optional>
788
<optional>
789
<attribute name="syllable-count">
790
<ref name="nonNegativeInteger"/>
791
</attribute>
792
</optional>
793
<optional>
794
<attribute name="non-whitespace-character-count">
795
<ref name="nonNegativeInteger"/>
796
</attribute>
797
</optional>
798
<optional>
799
<attribute name="meta:row-count">
800
<ref name="nonNegativeInteger"/>
801
</attribute>
802
</optional>
803
<optional>
804
<attribute name="meta:cell-count">
805
<ref name="nonNegativeInteger"/>
806
</attribute>
807
</optional>
808
<optional>
809
<attribute name="meta:object-count">
810
<ref name="nonNegativeInteger"/>
811
</attribute>
812
</optional>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 63 of 706

813
</element>
814
</define>
3.2 User-defined Metadata
The <meta:user-defined> element specifies any additional user-defined metadata for the
document. Each instance of this element can contain one piece of user-defined metadata. The
element contains:

A meta:name attribute, which identifies the name of the metadata element.

An optional meta:type attribute, which identifies the type of the metadata element. The
allowed meta types are float, date, time, boolean and string (see also section 6.7.1).

(see section 6.7.1).

The value of the element, which is the metadata in the format described in section 6.7.1 as
value of the office:value attributes for the various data types.
The default type for meta-data elements is string.
815
<define name="office-meta-data" combine="choice">
816
<element name="meta:user-defined">
817
<attribute name="meta:name">
818
<ref name="string"/>
819
</attribute>
820
<choice>
821
<group>
822
<attribute name="meta:value-type">
823
<value>float</value>
824
</attribute>
825
<ref name="double"/>
826
</group>
827
<group>
828
<attribute name="meta:value-type">
829
<value>date</value>
830
</attribute>
831
<ref name="dateOrDateTime"/>
832
</group>
833
<group>
834
<attribute name="meta:value-type">
835
<value>time</value>
836
</attribute>
837
<ref name="duration"/>
838
</group>
839
<group>
840
<attribute name="meta:value-type">
841
<value>boolean</value>
842
</attribute>
843
<ref name="boolean"/>
844
</group>
845
<group>
846
<attribute name="meta:value-type">
847
<value>string</value>
848
</attribute>
849
<ref name="string"/>
850
</group>
851
<text/>
852
</choice>
853
</element>
854
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 64 of 706

3.3 Custom Metadata
In addition to the pre-defined metadata elements, applications should also preserve any
additional content found inside the <office:meta> element. As there is no semantics specified
for such foreign content, applications need not process this information other than to preserve it
when editing the document.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 65 of 706

4 Text Content
4.1 Headings, Paragraphs and Basic Text Structure
This section describes the XML elements and attributes that are used to represent heading and
paragraph components in a text document.
The elements <text:h> and <text:p> represent headings and paragraphs, respectively, and
are collectively referred to as paragraph elements. Al text content in an OpenDocument file
must be contained in either of these elements.
4.1.1 Headings
Headings define the chapter structure for a document. A chapter or subchapter begins with a
heading and extends to the next heading at the same or higher level.
855
<define name="text-h">
856
<element name="text:h">
857
<ref name="heading-attrs"/>
858
<ref name="paragraph-attrs"/>
859
<optional>
860
<ref name="text-number"/>
861
</optional>
862
<zeroOrMore>
863
<ref name="paragraph-content"/>
864
</zeroOrMore>
865
</element>
866
</define>
Heading Level
The text:outline-level attribute associated with the heading element determines the level
of the heading, starting with 1. Headings without a level attribute are assumed to be at level 1.
867
<define name="heading-attrs" combine="interleave">
868
<attribute name="text:outline-level">
869
<ref name="positiveInteger"/>
870
</attribute>
871
</define>
Heading Numbering
Header numbering can be changed by additional attributes, similar to those on list items (see
section 4.3.2, below). The numbering of headers can be restarted by setting the
text:restart-numbering attribute to true.
872
<define name="heading-attrs" combine="interleave">
873
<optional>
874
<attribute name="text:restart-numbering" a:defaultValue="false">
875
<ref name="boolean"/>
876
</attribute>
877
</optional>
878
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 66 of 706

Start Value
The attribute text:start-value may be used to restart the numbering of headers of the
current header's level, by setting a new value for the numbering.
879
<define name="heading-attrs" combine="interleave">
880
<optional>
881
<attribute name="text:start-value">
882
<ref name="nonNegativeInteger"/>
883
</attribute>
884
</optional>
885
</define>
Suppress Header Numbering
It is sometimes desired to have a specific heading which should not be numbered. This
corresponds to unnumbered list headers in lists (see sections 4.3). To facilitate this, an optional
attribute text:is-list-header can be used. If true, the given header will not be numbered,
even if an explicit list-style is given.
886
<define name="heading-attrs" combine="interleave">
887
<optional>
888
<attribute name="text:is-list-header" a:defaultValue="false">
889
<ref name="boolean"/>
890
</attribute>
891
</optional>
892
</define>
Formatted Heading Number
If a heading has a numbering applied, the text of the formatted number can be included in a
<text:number> element. This text can be used by applications that do not support numbering
of headings, but it will be ignored by applications that support numbering.
893
<define name="text-number">
894
<element name="text:number">
895
<ref name="string"/>
896
</element>
897
</define>
4.1.2 Paragraphs
Paragraphs are the basic unit of text.
898
<define name="text-p">
899
<element name="text:p">
900
<ref name="paragraph-attrs"/>
901
<zeroOrMore>
902
<ref name="paragraph-content"/>
903
</zeroOrMore>
904
</element>
905
</define>
4.1.3 Common Paragraph Elements Attributes
The paragraph elements have text:style-name, text:class-names and text:cond-
style-name attributes. These attributes must reference paragraph styles.
A text:style-name attribute references a paragraph style, while a text:cond-style-name
attribute references a conditional-style, that is, a style that contains conditions and maps to other
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 67 of 706

styles (see section 14.1.1). If a conditional style is applied to a paragraph, the text:style-
name attribute contains the name of the style that was the result of the conditional style
evaluation, while the conditional style name itself is the value of the text:cond-style-name
attribute. This XML structure simplifies [XSLT] transformations because XSLT only has to
acknowledge the conditional style if the formatting attributes are relevant. The referenced style
can be a common style or an automatic style.
A text:class-names attribute takes a whitespace separated list of paragraph style names.
The referenced styles are applied in the order they are contained in the list. If both,
text:style-name and text:class-names are present, the style referenced by the
text:style-name attribute is as the first style in the list in text:class-names. If a
conditional style is specified together with a style:class-names attribute, but without the
text:style-name attribute, then the first style in the style list is used as the value of the
missing text:style-name attribute.
Conforming applications should support the text:class-names attribute and also should
preserve it while editing.
906
<define name="paragraph-attrs">
907
<optional>
908
<attribute name="text:style-name">
909
<ref name="styleNameRef"/>
910
</attribute>
911
</optional>
912
<optional>
913
<attribute name="text:class-names">
914
<ref name="styleNameRefs"/>
915
</attribute>
916
</optional>
917
<optional>
918
<attribute name="text:cond-style-name">
919
<ref name="styleNameRef"/>
920
</attribute>
921
</optional>
922
</define>
Example: Styles and conditional styles
<text:p text:style-name="Heading 1">
"Heading 1" is not a conditional style.
</text:p>
<text:p text:style-name="Numbering 1" text:cond-style-name="Text body">
"Text body" is a conditional style. If it is contained in a numbered
paragraph, it maps to "Numbering 1". This is assumed in this example.
</text:p>
A paragraph may have an ID. This ID can be used to reference the paragraph from other
elements.
923
<define name="paragraph-attrs" combine="interleave">
924
<optional>
925
<ref name="text-id"/>
926
</optional>
927
</define>
4.2 Page Sequences
A page sequence element <text:page-sequence> specifies a sequence of master pages that
are instantiated in exactly the same order as they are referenced in the page sequence. If a text
document contains a page sequence, it will consist of exactly as many pages as specified.
Documents with page sequences do not have a main text flow consisting of headings and
paragraphs as is the case for documents that do not contain a page sequence. Text content is
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 68 of 706

included within text boxes for documents with page sequences. The only other content that is
permitted are drawing objects.
Example: Page Sequence
<style:automatic-style>
<style:page-layout name="pm1">
<!-- portrait page -->
</style:page-layout>
<style:page-layout name="pm2">
<!-- landscape page -->
</style:page-layout>
</style:automatic-style>
...
<style:master-styles>
<style:master-page name="portrait" style:page-layout-name="pm1"/>
<style:master-page name="landscape" style:page-layout-name="pm2"/>
</style:master-styles>
...
<office:body>
<text:page-sequence>
<text:page text:master-page-name="portrait"/>
<text:page text:master-page-name="portrait"/>
<text:page text:master-page-name="landscape"/>
<text:page text:master-page-name="landscape"/>
<text:page text:master-page-name="portrait"/>
</text:page-sequence>
<draw:frame ...>
<draw:text-box ...>
<text:p>Example text.</text:p>
...
</draw:text-box>
</draw:frame>
</office:body>
928
<define name="text-page-sequence">
929
<element name="text:page-sequence">
930
<oneOrMore>
931
<ref name="text-page"/>
932
</oneOrMore>
933
</element>
934
</define>
4.2.1 Page
The <text:page> element specifies a single page within a page sequence.
935
<define name="text-page">
936
<element name="text:page">
937
<ref name="text-page-attlist"/>
938
<empty/>
939
</element>
940
</define>
Master Page Name
The text:master-page-name attribute specifies the master page that is instantiated.
941
<define name="text-page-attlist">
942
<attribute name="text:master-page-name">
943
<ref name="styleNameRef"/>
944
</attribute>
945
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 69 of 706

4.3 Lists
The OpenDocument format supports list structures, similar to those found in [HTML4]. A list is a
paragraph-level element, which contains an optional list header, followed by a sequence of list
items. The list header and each list item contains a sequence of paragraph or list elements. Lists
can be nested.
Lists may be numbered. The numbering may be restarted with a specific numbering at each list
item. Lists may also continue numbering from other lists, allowing the user to merge several lists
into a single, discontinuous list. Note that whether the list numbering is displayed depends on a
suitable list style being used.
In addition to this structural information, lists can have list styles associated with them, which
contain the relevant layout information, such as
• the type of list item label, such as bullet or number,
• list item label width and distance,
• bullet character or image (if any),
• number format for the bullet numbering (if any),
• paragraph indent for list items.
4.3.1 List Block
A list is represented by the <text:list> element. It contains an optional list header, fol owed
by any number of list items.
Every list has a list level, which is determined by the nesting of the <text:list> elements. If a
list is not contained within another list, the list level is 1. If the list in contained within another list,
the list level is the list level of the list in which is it contained incremented by one. If a list is
contained in a table cell or text box, the list level returns to 1, even though the table or textbox
itself may be nested within another list.
The attributes that may be associated with the list element are:
• Style name
• Continue numbering
946
<define name="text-list">
947
<element name="text:list">
948
<ref name="text-list-attr"/>
949
<optional>
950
<ref name="text-list-header"/>
951
</optional>
952
<zeroOrMore>
953
<ref name="text-list-item"/>
954
</zeroOrMore>
955
</element>
956
</define>
Style Name
The optional text:style-name attribute specifies the name of the list style that is applied to
the list.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 70 of 706

If this attribute is not included and therefore no list style is specified, one of the following actions
is taken:
• If the list is contained within another list, the list style defaults to the style of the surrounding
list.
• If there is no list style specified for the surrounding list, but the list contains paragraphs that
have paragraph styles attached specifying a list style, this list style is used for any of these
paragraphs.
• A default list style is applied to any other paragraphs.
To determine which formatting properties are applied to a list, the list level and list style name
are taken into account. See section 14.10 for more information on list formatting properties.
957
<define name="text-list-attr" combine="interleave">
958
<optional>
959
<attribute name="text:style-name">
960
<ref name="styleNameRef"/>
961
</attribute>
962
</optional>
963
</define>
Continue Numbering
By default, the first list item in a list starts with the number specified in the list style. The continue
numbering attribute can be used to continue the numbering from the preceding list.
This attribute can be used with the <text:list> element and can have a value of true or
false.
If the value of the attribute is true and the numbering style of the preceding list is the same as
the current list, the number of the first list item in the current list is the number of the last item in
the preceding list incremented by one.
964
<define name="text-list-attr" combine="interleave">
965
<optional>
966
<attribute name="text:continue-numbering">
967
<ref name="boolean"/>
968
</attribute>
969
</optional>
970
</define>
4.3.2 List Item
List items contain the textual content of a list. A <text:list-item> element can contain
paragraphs or lists. A list item cannot contain headings or tables.
971
<define name="text-list-item">
972
<element name="text:list-item">
973
<ref name="text-list-item-attr"/>
974
<ref name="text-list-item-content"/>
975
</element>
976
</define>
977
<define name="text-list-item-content">
978
<optional>
979
<ref name="text-number"/>
980
</optional>
981
<zeroOrMore>
982
<choice>
983
<ref name="text-p"/>
984
<ref name="text-h"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 71 of 706

985
<ref name="text-list"/>
986
</choice>
987
</zeroOrMore>
988
</define>
The first line in a list item is preceded by a bullet or number, depending on the list style assigned
to the list. If a list item starts another list immediately and does not contain any text, no bullet or
number is displayed.
The only attribute that may be associated with the <text:list-item> element is:
• Start value
Start Value
The numbering of the current list can be restarted at a certain number. The text:start-
value attribute is used to specify the number with which to restart the list.
This attribute can only be applied to items in a list with a numbering list style. It restarts the
numbering of the list at the current item.
989
<define name="text-list-item-attr" combine="interleave">
990
<optional>
991
<attribute name="text:start-value">
992
<ref name="nonNegativeInteger"/>
993
</attribute>
994
</optional>
995
</define>
Formatted Number
If a list item has a numbering applied, the text of the formatted number can be included in a
<text:number> element. This text can be used by applications that do not support numbering,
but it will be ignored by applications that support numbering. See also section 4.1.1.
Example: Lists and sublists
<text:list text:style-name="List 1">
<text:list-item>
<text:p>This is the first list item</text:p>
<text:p>This is a continuation of the first list item.</text:p>
</text:list-item>
<text:list-item>
<text:p>This is the second list item.
It contains a sub list.</text:p>
<text:list>
<text:list-item><text:p>This is a sub list item.</text:p>
<text:list-item><text:p>This is a sub list item.</text:p>
<text:list-item><text:p>This is a sub list item.</text:p>
</text:list>
</text:list-item>
<text:list-item>
<text:p>This is the third list item</text:p>
</text:list-item>
</text:list>
4.3.3 List Header
A list header is a special kind of list item. It contains one or more paragraphs that are displayed
before a list. The paragraphs are formatted like list items but they do not have a preceding
number or bullet. The list header is represented by the list header element.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 72 of 706

996
<define name="text-list-header">
997
<element name="text:list-header">
998
<ref name="text-list-item-content"/>
999
</element>
1000
</define>
4.3.4 Numbered Paragraphs
In some instances, it is desirable to specify a list not as a structural element comprising of
several list items, but to determine on a per-paragraph level whether the paragraph is numbered,
and at which level. To facilitate this, the <text:numbered-paragraph> element allows the
numbering of an individual paragraph, as if it was part of a list at a specified level.
Numbered paragraphs may use the same continuous numbering properties that list items use,
and thus form an equivalent, alternative way of specifying lists. A list in <text:list>
representation could be converted into a list in <text:numbered-paragraph> representation
and vice versa.
1001
<define name="text-numbered-paragraph">
1002
<element name="text:numbered-paragraph">
1003
<ref name="text-numbered-paragraph-attr"/>
1004
<optional>
1005
<ref name="text-number"/>
1006
</optional>
1007
<choice>
1008
<ref name="text-p"/>
1009
<ref name="text-h"/>
1010
</choice>
1011
</element>
1012
</define>
A numbered paragraph can be assigned a list level. A numbered paragraph is equivalent to a list
nested to the given level, containing one list item with one paragraph. If no level is given, the
numbered paragraph is interpreted as being on level 1.
1013
<define name="text-numbered-paragraph-attr" combine="interleave">
1014
<optional>
1015
<attribute name="text:level" a:defaultValue="1">
1016
<ref name="positiveInteger"/>
1017
</attribute>
1018
</optional>
1019
</define>
As a numbered paragraph combines the functionality of a (possibly nested) list with a single list
item, it can also use the attributes of those elements.
1020
<define name="text-numbered-paragraph-attr" combine="interleave">
1021
<ref name="text-list-attr"/>
1022
</define>
1023
<define name="text-numbered-paragraph-attr" combine="interleave">
1024
<ref name="text-list-item-attr"/>
1025
</define>
The text of a formatted number can be included in a <text:number> element. This text can be
used by applications that do not support numbering, but it will be ignored by applications that
support numbering. See also section 4.1.1.
4.4 Text Sections
A text section is a named region of paragraph-level text content. Sections start and end on
paragraph boundaries and can contain any number of paragraphs.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 73 of 706

Sections have two uses in the OpenDocument format: They can be used to assign certain
formatting properties to a region of text. They can also be used to group text that is automatically
acquired from some external data source.
In addition to Sections can contain regular text content or the text can be contained in another
file and linked to the section. Sections can also be write-protected or hidden.
Sections can have settings for text columns, background color or pattern, and notes
configuration. These settings form the section style, which is represented in a <style:style>
element. See section 14.8.3 for details.
The formatting properties for sections are explained in section 15.7.
Sections support two ways of linking to external content. If a section is linked to another
document, the link can be through one of the fol owing:

A resource identified by an XLink, represented by a text:section-source element

Dynamic Data Exchange (DDE), represented by a office:dde-source element
Linking information for external content is contained in the section element's first child. A section
that links to external content contains the ful representation of the data source, so that
processors need to understand the linking information only if they wish to update the contents of
the section.
1026
<define name="text-section">
1027
<element name="text:section">
1028
<ref name="text-section-attr"/>
1029
<choice>
1030
<ref name="text-section-source"/>
1031
<ref name="text-section-source-dde"/>
1032
<empty/>
1033
</choice>
1034
<zeroOrMore>
1035
<ref name="text-content"/>
1036
</zeroOrMore>
1037
</element>
1038
</define>
Note: List items may not contain sections. Thus, lists may only be wholly contained within
section elements. If it is desired to achieve the effect of overlapping lists and sections, or of
sections contained within lists, the lists must be split into several lists, each of which would then
be wholly contained within a section. When splitting the list, suitable attributes for continuos
numbering should be set such that display and behavior are the same as with the original list not
interrupted by sections.
4.4.1 Section Attributes
Text indices, described in chapter 7, may be considered a special kind of text section, as they
share the same general structure as well as certain attributes. These are combined in the
following definition:
1039
<define name="text-section-attr" combine="interleave">
1040
<ref name="sectionAttr"/>
1041
</define>
The remaining attributes in this section are specific to the <text:section> element.
Section Style
The text:style-name attribute refers to a section style.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 74 of 706

1042
<define name="sectionAttr" combine="interleave">
1043
<optional>
1044
<attribute name="text:style-name">
1045
<ref name="styleNameRef"/>
1046
</attribute>
1047
</optional>
1048
</define>
Section Name
Every section must have a name that uniquely identifies the section. The text:name attribute
contains the name of the section.
1049
<define name="sectionAttr" combine="interleave">
1050
<attribute name="text:name">
1051
<ref name="string"/>
1052
</attribute>
1053
</define>
Protected Sections
A section can be protected, which means that a user can not edit the section. The
text:protected attribute indicates whether or not a section is protected. The user interface
must enforce the protection attribute if it is enabled.
1054
<define name="sectionAttr" combine="interleave">
1055
<optional>
1056
<attribute name="text:protected">
1057
<ref name="boolean"/>
1058
</attribute>
1059
</optional>
1060
</define>
A user can use the user interface to reset the protection flag, unless the section is further
protected by a password. In this case, the user must know the password in order to reset the
protection flag. The text:protection-key attribute specifies the password that protects the
section. To avoid saving the password directly into the XML file, only a hash value of the
password is stored.
1061
<define name="sectionAttr" combine="interleave">
1062
<optional>
1063
<attribute name="text:protection-key">
1064
<ref name="string"/>
1065
</attribute>
1066
</optional>
1067
</define>
Hidden Sections and Conditional Sections
Sections can be hidden based on a condition or they can be hidden unconditionally.
The text:display attribute specifies whether or not the section is hidden. The value of this
attribute can be:

true, the section is displayed. This is the default setting.

none, the section is hidden unconditionally.

condition, the section is hidden under the condition specified in the text:condition
attribute.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 75 of 706

The text:condition attribute specifies the condition under which the section is hidden. The
condition is encoded as a string. If the value of text:display is condition, the
text:condition attribute must be present.
1068
<define name="text-section-attr" combine="interleave">
1069
<choice>
1070
<attribute name="text:display">
1071
<choice>
1072
<value>true</value>
1073
<value>none</value>
1074
</choice>
1075
</attribute>
1076
<group>
1077
<attribute name="text:display">
1078
<value>condition</value>
1079
</attribute>
1080
<attribute name="text:condition">
1081
<ref name="string"/>
1082
</attribute>
1083
</group>
1084
<empty/>
1085
</choice>
1086
</define>
4.4.2 Section Source
The <text:section-source> element indicates that the enclosed section is a linked section.
If this element is used, it must be the first element in the <text:section> element.
1087
<define name="text-section-source">
1088
<element name="text:section-source">
1089
<ref name="text-section-source-attr"/>
1090
</element>
1091
</define>
The attributes that may be associated with the <text:section-source> attribute are:

Section source URL

Name of linked section

Filter name
Section Source URL
These attributes identify the document or section to which the section is linked. The name of the
target section is identified by the local part of the URL, following the hash mark. The
xlink:href attribute is implied because <text:section-source> elements may also link to
internal sections.
1092
<define name="text-section-source-attr" combine="interleave">
1093
<optional>
1094
<attribute name="xlink:href">
1095
<ref name="anyURI"/>
1096
</attribute>
1097
<optional>
1098
<attribute name="xlink:type" a:defaultValue="simple">
1099
<value>simple</value>
1100
</attribute>
1101
</optional>
1102
<optional>
1103
<attribute name="xlink:show" a:defaultValue="embed">
1104
<value>embed</value>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 76 of 706

1105
</attribute>
1106
</optional>
1107
</optional>
1108
</define>
Name of Linked Section
If the link targets a section of a document, the attribute text:section name contains the name
of the target section. If the attribute is not present, the link targets the entire document.
1109
<define name="text-section-source-attr" combine="interleave">
1110
<optional>
1111
<attribute name="text:section-name">
1112
<ref name="string"/>
1113
</attribute>
1114
</optional>
1115
</define>
Filter Name
The text:filter-name attribute specifies which filter type was used to import the link target.
The value of this attribute is implementation dependent.
1116
<define name="text-section-source-attr" combine="interleave">
1117
<optional>
1118
<attribute name="text:filter-name">
1119
<ref name="string"/>
1120
</attribute>
1121
</optional>
1122
</define>
4.4.3 DDE Source
If sections are linked via DDE, their linking information is represented by <office:dde-
source> elements. It contains attributes that specify the application, topic and item of the DDE
connection. Note that because the section contains the XML rendition of the DDE link's content,
this information only needs to be processed if updated data from the DDE link are desired.
1123
<define name="text-section-source-dde">
1124
<ref name="office-dde-source"/>
1125
</define>
4.5 Page-bound graphical content
Within text documents, images, embedded objects and other drawing objects appear at the level
of a paragraph if they are anchored to a page rather than to a paragraph or a character position
within a paragraph. See section 9.2 for details on drawing objects, and section 9.2.16 for their
anchoring.
4.6 Change Tracking
This section describes how changes in text documents can be represented.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 77 of 706

4.6.1 Tracked Changes
All tracked changes to text documents are stored in a list. The list contains an element for each
change made to the document. If the <text:tracked-changes> element is absent, change
tracking is not enabled.
1126
<define name="text-tracked-changes">
1127
<optional>
1128
<element name="text:tracked-changes">
1129
<ref name="text-tracked-changes-attr"/>
1130
<zeroOrMore>
1131
<ref name="text-changed-region"/>
1132
</zeroOrMore>
1133
</element>
1134
</optional>
1135
</define>
Track Changes
This attribute determines whether or not user agents should track and record changes for this
document.
1136
<define name="text-tracked-changes-attr" combine="interleave">
1137
<optional>
1138
<attribute name="text:track-changes" a:defaultValue="true">
1139
<ref name="boolean"/>
1140
</attribute>
1141
</optional>
1142
</define>
4.6.2 Changed Regions
For every changed region of a document, there is one entry in the list of tracked changes. This
entry contains a list of all changes that were applied to the region. The start and end of this
region are marked by the start and end elements that are described in the next section.
1143
<define name="text-changed-region">
1144
<element name="text:changed-region">
1145
<ref name="text-changed-region-attr"/>
1146
<ref name="text-changed-region-content"/>
1147
</element>
1148
</define>
Change ID
Every element has an ID. The elements that mark the start and end of a region use this ID to
identify the region to which they belong.
1149
<define name="text-changed-region-attr" combine="interleave">
1150
<attribute name="text:id">
1151
<ref name="ID"/>
1152
</attribute>
1153
</define>
4.6.3 Insertion
The <text:insertion> element contains the information that is required to identify any
insertion of content. This content can be a piece of text within a paragraph, a whole paragraph,
or a whole table. The inserted content is part of the text document itself and is marked by a
change start and a change end element.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 78 of 706

1154
<define name="text-changed-region-content" combine="choice">
1155
<element name="text:insertion">
1156
<ref name="office-change-info"/>
1157
</element>
1158
</define>
Example: Insertion of text
<text:tracked-changes>
<text:changed-region text:id="c001">
<text:insertion>
<office:change-info>
<dc:creator>Michael Brauer</dc:creator>
<dc:date>1999-05-18T12:56:04</dc:date>
</office:change-info>
</text:insertion>
</text:changed-region>
</text:tracked-changes>
<text:p>
This is the original text<text:change-start text:change-id="c001"/>,
but this has been added</text:change-end text:change-id="c001"/>.
</text:p>
4.6.4 Deletion
A <text:deletion> element contains content that was deleted while change tracking was
enabled. The position where the text was deleted is marked by the change position element.
If part of a paragraph was deleted, the text that was deleted is contained in this element as a
paragraph element. If the deleted text is reinserted into the document, the paragraph is joined
with the paragraph where the deletion took place.
1159
<define name="text-changed-region-content" combine="choice">
1160
<element name="text:deletion">
1161
<ref name="office-change-info"/>
1162
<zeroOrMore>
1163
<ref name="text-content"/>
1164
</zeroOrMore>
1165
</element>
1166
</define>
Example: Deletion of text
<text:tracked-changes>
<text:changed-region text:id="c002">
<text:deletion>
<office:change-info>
<dc:creator>Michael Brauer</dc:creator>
<dc:date>1999-05-18T12:56:04</dc:date>
</office:change-info>
<text:p>, but this has been deleted</text:p>
</text:deletion>
</text:changed-region>
</text:tracked-changes>
<text:p>
This is the original text<text:change text:region-id="c002"/>.
</text:p>
This example shows:

Deleted text = , but this has been deleted
This text is contained in the <text:p> element within the <text:deletion> element.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 79 of 706


Current text = This is the original text.
This text is contained in the <text:p> element at the end of the example.

Original text before deletion took place = This is the original text, but this
has been deleted.
Note that the deleted text, like all text in the OpenDocument format, is contained in a paragraph
element. To reconstruct the original text, this paragraph is merged with its surrounding. In other
words, a deletion consisting of only a single word would be represented as a paragraph
containing the word.
To reconstruct the text before the deletion took place, do:
• If the change mark is inside a paragraph, insert the text content of the <text:deletion>
element as if the beginning <text:p> and final </text:p> tags were missing.
• If the change mark is inside a header, proceed as above, except adapt the inserted tags to
math their new counterparts.
• Otherwise, simply copy the text content of the <text:deletion> element in place of the change
mark.
Example: Given the following change:
<text:changed-region text:id="example">
<text:deletion>
<office:change-info>...</office:change-info>
<text:p>Hello</text:p>
<text:p>World!</text:p>
</text:deletion>
</text:changed-region>
The first (and most common) case occurs if a change mark is inside a regular paragraph:
<text:p>abc<text:change text:id="example/>def</text:p>
To reconstruct the original text, the two <text:p> elements are copied to replace the change
mark, except the beginning and ending tags are missing:
<text:p>abcHello</text:p>
<text:p>World!def</text:p>
If the change mark occurred inside a header, the same procedure is fol owed, except the copied
tags are adapted to make sure we still have well-formed XML.
<text:h>abc<text:change text:id="example/>def</text:h>
becomes:
<text:h>abcHello</text:h>
<text:h>World!def</text:h>
The third case occurs when a change occurs outside of a paragraph. In this case, the deleted
text is simply copied verbatim.
<text:p>abcdef</text:p>
<text:change text:id="example/>
<text:p>ghijkl</text:p>
This becomes:
<text:p>abcdef</text:p>
<text:h>Hello</text:h>
<text:h>World!</text:h>
<text:p>ghijkl</text:p>
If, in the first two cases, the deletion contains complete paragraphs, then additional empty
paragraphs must be put into the <text:deletion> element to achieve the desired result.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 80 of 706

The change that took place from
<text:p>abc</text:p>
<text:h>Hello</text:h>
<text:h>World!</text:h>
<text:p>def</text:p>
to
<text:p>abc<text:change text:id="example/>def</text:p>
would be represented as:
<text:changed-region text:id="example">
<text:deletion>
<office:change-info>...</office:change-info>
<text:p/>
<text:p>Hello</text:p>
<text:p>World!</text:p>
<text:p/>
</text:deletion>
</text:changed-region>
4.6.5 Format Change
A format change element represents any change in formatting attributes. The region where the
change took place is marked by a change start and a change end element.
1167
<define name="text-changed-region-content" combine="choice">
1168
<element name="text:format-change">
1169
<ref name="office-change-info"/>
1170
</element>
1171
</define>
Note: A format change element does not contain the actual changes that took place.
4.6.6 Change Info
The change info element contains meta information who made the change and when. It is also
used for spreadsheet documents, and thus described in a section 12.3 (Change Tracking
Metadata).
4.6.7 Change Marks
There are three elements that mark the start and the end of a changed region, as follows:

Change start element – <text:change-start>
This element marks the start of a region with content where text has been inserted or the
format has been changed.

Change end element – <text:change-end>
This element marks the end of a region with content where text has been inserted or the
format has been changed.

Change position element – <text:change>
This element marks a position in an empty region where text has been deleted.
All three elements have an attribute that specifies the ID of the region to which they belong.
1172
<define name="change-marks">
1173
<choice>
1174
<element name="text:change">
1175
<ref name="change-mark-attr"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 81 of 706

1176
</element>
1177
<element name="text:change-start">
1178
<ref name="change-mark-attr"/>
1179
</element>
1180
<element name="text:change-end">
1181
<ref name="change-mark-attr"/>
1182
</element>
1183
</choice>
1184
</define>
1185
<define name="change-mark-attr">
1186
<attribute name="text:change-id">
1187
<ref name="IDREF"/>
1188
</attribute>
1189
</define>
4.7 Text Declarations
Several text elements need per-document declarations before they can be used. For example,
variable fields require that the variables used are being declared at the beginning of the
document. These declarations are collected at the beginning of a text document. Al such
declarations are optional. The detailed description for each declaration can be found in the
appropriate chapter.
The supported text declarations are:
• variable declarations – These declarations are used for variable fields. (cf. section 6.3.1).
• user field declarations – These declarations are used for user-defined fields (cf. section
6.3.5).
• sequence declarations – These declarations are used for sequence fields (cf. section 6.3.8).
• DDE connections – These declarations are used for DDE fields and DDE sections (cf.
sections 6.6.9 and 4.4.3, respectively).
• auto mark file – This declaration is used for generation of alphabetical indices (cf. section
7.8.2).
1190
<define name="text-decls">
1191
<optional>
1192
<element name="text:variable-decls">
1193
<zeroOrMore>
1194
<ref name="text-variable-decl"/>
1195
</zeroOrMore>
1196
</element>
1197
</optional>
1198
<optional>
1199
<element name="text:sequence-decls">
1200
<zeroOrMore>
1201
<ref name="text-sequence-decl"/>
1202
</zeroOrMore>
1203
</element>
1204
</optional>
1205
<optional>
1206
<element name="text:user-field-decls">
1207
<zeroOrMore>
1208
<ref name="text-user-field-decl"/>
1209
</zeroOrMore>
1210
</element>
1211
</optional>
1212
<optional>
1213
<element name="text:dde-connection-decls">
1214
<zeroOrMore>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 82 of 706

1215
<ref name="text-dde-connection-decl"/>
1216
</zeroOrMore>
1217
</element>
1218
</optional>
1219
<optional>
1220
<ref name="text-alphabetical-index-auto-mark-file"/>
1221
</optional>
1222
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 83 of 706

5 Paragraph Elements Content
5.1 Basic Text Content
Paragraph element's children make up the text content of any document. Al text contained in a
paragraph element or their children is text content, with few exceptions detailed later. This
should significantly ease transformations into other formats, since transformations may ignore
any child elements of paragraph elements and only process their text content, and stil obtain a
faithful representation of text content.
Text content elements that do not contain in-line text children are:

(foot- and end-)notes (see section 5.3)
Foot- and endnotes contain text content, but are typically displayed outside the main text
content, e.g. at the end of a page or document.

rubies (see section 5.4)
Ruby texts are usually displayed above or below the main text.

annotations (see section 5.5)
Annotations are typically not displayed.
1223
<define name="paragraph-content" combine="choice">
1224
<text/>
1225
</define>
5.1.1 White-space Characters
If the paragraph element or any of its child elements contains white-space characters, they are
collapsed, in other words they are processed in the same way that [HTML4] processes them. The
following Unicode characters are normalized to a SPACE character:

HORIZONTAL TABULATION (0x0009)

CARRIAGE RETURN (0x000D)

LINE FEED (0x000A)

SPACE (0x0020)
In addition, these characters are ignored if the preceding character is a white-space character.
The preceding character can be contained in the same element, in the parent element, or in the
preceding sibling element, as long as it is contained within the same paragraph element and the
element in which it is contained processes white-space characters as described above.
White-space processing takes place within the following elements:

<text:p>

<text:h>

<text:span>

<text:a>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 84 of 706


<text:ref-point>

<text:ref-point-start>

<text:ref-point-end>

<text:bookmark>

<text:bookmark-start>

<text:bookmark-end>
Note: In [XSL], white-space processing of a paragraph of text can be enabled by attaching an
fo:white-space="collapse" attribute to the <fo:block> element that corresponds to the
paragraph element.
Space Character
In general, consecutive white-space characters in a paragraph are collapsed. For this reason,
there is a special XML element used to represent the Unicode character SPACE (0x0020).
This element uses an optional attribute called text:c to specify the number of SPACE
characters that the element represents. A missing text:c attribute is interpreted as meaning a
single SPACE character.
This element is required to represent the second and all following SPACE characters in a
sequence of SPACE characters. It is not an error if the character preceding the element is not a
white-space character, but it is good practice to use this element for the second and all following
SPACE characters in a sequence. This way, an application recognizes a single space character
without recognizing this element.
1226
<define name="paragraph-content" combine="choice">
1227
<element name="text:s">
1228
<optional>
1229
<attribute name="text:c">
1230
<ref name="nonNegativeInteger"/>
1231
</attribute>
1232
</optional>
1233
</element>
1234
</define>
Tab Character
The <text:tab> element represents the Unicode tab character HORIZONTAL TABULATION
(0x0009) in a heading or paragraph. A <text:tab> element reserves space from the current
position up to the next tab-stop, as defined in the paragraph's style information.
1235
<define name="paragraph-content" combine="choice">
1236
<element name="text:tab">
1237
<ref name="text-tab-attr"/>
1238
</element>
1239
</define>
To determine which tab-stop a tab character will advance to requires layout information. To
make it easier for non-layout oriented processors to determine this information, applications may
generate a text:tab-ref attribute as a hint that associates a tab character with a tab-stop in the
current paragraph style. It contains the number of the tab-stop that the tab character refers to.
The position 0 has a special meaning and signifies the start margin of the paragraph.
1240
<define name="text-tab-attr">
1241
<optional>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 85 of 706

1242
<attribute name="text:tab-ref">
1243
<ref name="nonNegativeInteger"/>
1244
</attribute>
1245
</optional>
1246
</define>
Note: The text:tab-ref attribute is only a hint to help non-layouting processors to determine the
tab/tab-stop association. Layouters should determine the tab positions solely based on the style
information.
Line Breaks
The <text:line-break> element represents a line break in a heading or paragraph.
1247
<define name="paragraph-content" combine="choice">
1248
<element name="text:line-break">
1249
<empty/>
1250
</element>
1251
</define>
5.1.2 Soft Hyphens, Hyphens, and Non-breaking Blanks
Soft hyphens, hyphens, and non-breaking blanks are represented by UNICODE characters.
The UNICODE character...
Represents...
SOFT HYPHEN (00AD)
soft hyphens
NON-BREAKING HYPHEN
non-breaking hyphens
(2011)
NO-BREAK SPACE (00A0)
non-breaking blanks
5.1.3 Attributed Text
The <text:span> element represents portions of text that are attributed using a certain text
style or class. The content of this element is the text that uses the text style.
The name of the a text style or text class is the value of a text:style-name or text:class-
names attributes, respectively, attached to the <text:span> element. These attributes must
refer to text styles or classes.
A text:style-name attribute references a single text style. A text:class-names attribute takes
a whitespace separated list of text style names. The referenced text styles are applied in the
order they are contained in the list. If both, text:style-name and text:class-names are
present, the style referenced by the text:style-name attribute is treated as the first style in
the list in text:class-names. Conforming application should support the text:class-names
attribute and also should preserve it while editing.
<text:span> elements can be nested.
White-space characters contained in this element are collapsed.
1252
<define name="paragraph-content" combine="choice">
1253
<element name="text:span">
1254
<optional>
1255
<attribute name="text:style-name">
1256
<ref name="styleNameRef"/>
1257
</attribute>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 86 of 706

1258
</optional>
1259
<optional>
1260
<attribute name="text:class-names">
1261
<ref name="styleNameRefs"/>
1262
</attribute>
1263
</optional>
1264
<zeroOrMore>
1265
<ref name="paragraph-content"/>
1266
</zeroOrMore>
1267
</element>
1268
</define>
Example: Text style in OpenDocument documents:
<text:p>
The last word of this sentence is
<text:span text:style-name="emphasize">emphasized</text:span>.
</text:p>
5.1.4 Hyperlinks
Hyperlinks in text documents are represented by a <text:a> element.
This element also contains an event table element, <office:event-listeners>, which
contains the events assigned to the hyperlink. See section 12.4 for more information on the
event table element.
1269
<define name="paragraph-content" combine="choice">
1270
<element name="text:a">
1271
<ref name="text-a-attlist"/>
1272
<optional>
1273
<ref name="office-event-listeners"/>
1274
</optional>
1275
<zeroOrMore>
1276
<ref name="paragraph-content"/>
1277
</zeroOrMore>
1278
</element>
1279
</define>
The attributes that may be associated with the <text:a> element are:

Name

Link location

Target frame

Text styles
Name
A hyperlink can have a name, but it is not essential. The office:name attribute specifies the
name of the hyperlink if one exists. This name can serve as a target for some other hyperlinks.
1280
<define name="text-a-attlist" combine="interleave">
1281
<optional>
1282
<attribute name="office:name">
1283
<ref name="string"/>
1284
</attribute>
1285
</optional>
1286
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 87 of 706

Link Location
The xlink:href attribute specifies the URL for the target location of the link.
1287
<define name="text-a-attlist" combine="interleave">
1288
<attribute name="xlink:href">
1289
<ref name="anyURI"/>
1290
</attribute>
1291
<optional>
1292
<attribute name="xlink:type" a:defaultValue="simple">
1293
<value>simple</value>
1294
</attribute>
1295
</optional>
1296
<optional>
1297
<attribute name="xlink:actuate" a:defaultValue="onRequest">
1298
<value>onRequest</value>
1299
</attribute>
1300
</optional>
1301
</define>
Target Frame
The office:target-frame-name attribute specifies the target frame of the link. This attribute
can have one of the following values:

_self – The referenced document replaces the content of the current frame.

_blank – The referenced document is displayed in a new frame.

_parent – The referenced document is displayed in the parent frame of the current frame.

_top – The referenced document is displayed in the uppermost frame, that is the frame that
contains the current frame as a child or descendent but is not contained within another
frame.

A frame name – The referenced document is displayed in the named frame. If the named
frame does not exist, a new frame with that name is created.
To conform with the XLink Specification, an additional xlink:show attribute is attached to the
<text:a> element. If the value of the attribute is _blank, the xlink:show attribute value is
new. If the value of the attribute is any of the other value options, the value of the xlink:show
attribute is replace. See [XLink].
1302
<define name="text-a-attlist" combine="interleave">
1303
<optional>
1304
<attribute name="office:target-frame-name">
1305
<ref name="targetFrameName"/>
1306
</attribute>
1307
</optional>
1308
<optional>
1309
<attribute name="xlink:show">
1310
<choice>
1311
<value>new</value>
1312
<value>replace</value>
1313
</choice>
1314
</attribute>
1315
</optional>
1316
</define>
Text Styles
Every hyperlink has two text styles as follows:
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 88 of 706


If the link location of the hyperlink was not visited, the text style specifies by the
text:style-name attribute is applied to the text of the hyperlink.

If the link location of the hyperlink was already visited, the text style specified by the
text:visited-style-name attribute is applied to the text of the hyperlink
1317
<define name="text-a-attlist" combine="interleave">
1318
<optional>
1319
<attribute name="text:style-name">
1320
<ref name="styleNameRef"/>
1321
</attribute>
1322
</optional>
1323
<optional>
1324
<attribute name="text:visited-style-name">
1325
<ref name="styleNameRef"/>
1326
</attribute>
1327
</optional>
1328
</define>
5.2 Bookmarks and References
5.2.1 Bookmarks
Bookmarks can either mark a text position or a text range. A text range can start at any text
position and end at another text position. In particular, a bookmark can start in the middle of one
paragraph and end in the middle of another paragraph. The XML element used to represent a
bookmark varies depending on the type of bookmark, as follows:

<text:bookmark> – to mark one text position

<text:bookmark-start> – to mark the start position in a text range

<text:bookmark-end> – to mark the end position in a text range
For every <text:bookmark-start> element, there must be a <text:bookmark-end>
element in the same text flow using the same text:name attribute, and vice versa. The
<text:bookmark-start> element must precede the <text:bookmark-end> element.
1329
<define name="paragraph-content" combine="choice">
1330
<choice>
1331
<element name="text:bookmark">
1332
<attribute name="text:name">
1333
<ref name="string"/>
1334
</attribute>
1335
</element>
1336
<element name="text:bookmark-start">
1337
<attribute name="text:name">
1338
<ref name="string"/>
1339
</attribute>
1340
</element>
1341
<element name="text:bookmark-end">
1342
<attribute name="text:name">
1343
<ref name="string"/>
1344
</attribute>
1345
</element>
1346
</choice>
1347
</define>
Example: Bookmarks
<text:p>
<text:bookmark text:name="Mark 1"/>There is a text mark in front of this
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 89 of 706

paragraph.
<text:bookmark-start text:name="Mark 2"/>In front of this paragraph
there is
the start of a bookmark.
</text:p>
<text:p>
This bookmark ends
<text:bookmark-end text:name="Mark 2"/>
amid this sentence.
</text:p>
5.2.2 References
The representation of references is modeled on the XML representation of bookmarks. There are
two types of reference marks, as follows:

A point reference
A point reference marks a particular position in text and is represented by a single
<text:reference-mark> element.

A range reference
A range reference marks a range of characters in text and is represented by two elements;
<text:reference-mark-start> to mark the start of the range and <text:reference-
mark-end> to mark the end of the range.
Every reference is identified by its name, which must be unique. In a range reference, the start
and end elements must use the same reference name.
Point References
The <text:reference-mark> element represents a point reference.
1348
<define name="paragraph-content" combine="choice">
1349
<element name="text:reference-mark">
1350
<attribute name="text:name">
1351
<ref name="string"/>
1352
</attribute>
1353
</element>
1354
</define>
Range References
The <text:reference-mark-start> and <text:reference-mark-end> elements
represent a range reference.
1355
<define name="paragraph-content" combine="choice">
1356
<choice>
1357
<element name="text:reference-mark-start">
1358
<attribute name="text:name">
1359
<ref name="string"/>
1360
</attribute>
1361
</element>
1362
<element name="text:reference-mark-end">
1363
<attribute name="text:name">
1364
<ref name="string"/>
1365
</attribute>
1366
</element>
1367
</choice>
1368
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 90 of 706

In the OpenDocument schema, three elements are used to represent references instead of one
element because references represented as a single XML element:

Cannot support overlapping references

Do not interact well with other elements
Take the following example:
Example: Overlapping range references
<text:p>
<text:reference-mark-start text:name="first"/>This is an
<text:reference-mark-start text:name="second"/>example of a sentence
<text:reference-mark-end text:name="first"/>with overlapping
references.
<text:reference-mark-end text:name="second"/>
</text:p>
The example paragraph shows two references that cover the following text:
reference “first”
“This is an example of a sentence”
reference “second” “example of a sentence with overlapping
references.”
This overlapping structure cannot be represented using a single reference element to contain the
referenced text. Similarly, a reference spanning multiple paragraphs creates the same situation
as two overlapping XML elements, as does character formatting either starts or ends, but not
both, within the referenced text.
5.3 Notes
Notes consist of a <text:note> element which occurs in the text stream at the position to
which the note is anchored. How notes are numbered and rendered is determined by
<text:notes-configuration> element, which occurs inside the <office:styles>
section.
5.3.1 Note Element
The note element represents text notes which are attached to a certain text position. A common
implementation of this concept are the footnotes and endnotes found in most word processors. A
note contains a note citation element and a note body elements, which contains the note's
content.
In OpenDocument documents, notes are represented in a similar fashion to footnotes in [XSL]. In
XSL, the first child of the note element contains the citation in the form of an <fo:inline>
element. The OpenDocument schema uses the same structure but introduces a <text:note-
citation> element. The second child contains the note body, just as in XSL.
Additionally, OpenDocument features <text:notes-configuration> elements. To achieve
a similar effect to the note configuration in XSL, every note citation element must be formatted
appropriately.
1369
<define name="paragraph-content" combine="choice">
1370
<element name="text:note">
1371
<ref name="text-note-class"/>
1372
<optional>
1373
<attribute name="text:id">
1374
<ref name="string"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 91 of 706

1375
</attribute>
1376
</optional>
1377
<element name="text:note-citation">
1378
<optional>
1379
<attribute name="text:label">
1380
<ref name="string"/>
1381
</attribute>
1382
</optional>
1383
<text/>
1384
</element>
1385
<element name="text:note-body">
1386
<zeroOrMore>
1387
<ref name="text-content"/>
1388
</zeroOrMore>
1389
</element>
1390
</element>
1391
</define>
Note Class
Each note belongs to a class which determines how the note is expected to be rendered.
Currently, two note classes are supported: Footnotes and endnotes.
1392
<define name="text-note-class">
1393
<attribute name="text:note-class">
1394
<choice>
1395
<value>footnote</value>
1396
<value>endnote</value>
1397
</choice>
1398
</attribute>
1399
</define>
Footnote Reference ID
The footnote reference ID is used by references to footnotes to identify the footnote that is
referenced.
Note Citation Element
The <text:note-citation> element contains the formatted note citation element, either as a
formatted number or a string.
Note Label
Note citation elements can be labeled or numbered. If they are numbered, the number is chosen
and formatted automatically according to the notes configuration element. If they are labeled, the
user must supply a label for every note he/she inserts into the document. This label is stored in
the text:label attribute of the <text:note-citation> element.
Note Body
The <text:note-body> element contains the actual content of the footnote. It does not have
any attributes.
The schema allows for the inclusion of notes into the note body. While this may be reasonable
for some future note types, it is not reasonable for footnotes and endnotes. Conforming
applications may or may not support such nested notes.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 92 of 706

Footnote example
<text:p>
This paragraph contains a footnote
<text:note text:note-class="footnote" text:id="ftn001">
<text:note-citation>1</text:note-citation>
<text:note-body>
<text:p>
This footnote has a generated sequence number
</text:p>
</text:note-body>
</text:note>
.
</text:p>
<text:p>
This paragraph contains a footnote
<text:note text:note-class="footnote" text:id="ftn002">
<text:note-citation text:label="*">*</text:note-citation>
<text:note-body>
<text:p>
This footnote has a fixed citation
</text:p>
</text:note-body>
</text:note>
, too
</text:p>
5.4 Ruby
A ruby is additional text that is displayed above or below some base text. The purpose of ruby is
to annotate the base text or provide information about its pronunciation.
There are two elements that can be contained in the <text:ruby> element:

Ruby base

Ruby text
The <text:ruby-base> element contains the text that is to be annotated. It contains any
paragraph element content, like text spans. The element's text:style-name attribute
references a ruby style that specifies further formatting attributes of the ruby. See section 14.8.4
for details.
The <text:ruby-text > element contains the annotation text. It may contain only plain text.
The element's text:style-name attribute references a text style that specifies further
formatting attributes used for the text.
1400
<define name="paragraph-content" combine="choice">
1401
<element name="text:ruby">
1402
<optional>
1403
<attribute name="text:style-name">
1404
<ref name="styleNameRef"/>
1405
</attribute>
1406
</optional>
1407
<element name="text:ruby-base">
1408
<ref name="paragraph-content"/>
1409
</element>
1410
<element name="text:ruby-text">
1411
<optional>
1412
<attribute name="text:style-name">
1413
<ref name="styleNameRef"/>
1414
</attribute>
1415
</optional>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 93 of 706

1416
<text/>
1417
</element>
1418
</element>
1419
</define>
5.5 Text Annotation
The OpenDocument format allows annotation to appear within a paragraph element. See section
12.1 for details on annotations.
1420
<define name="paragraph-content" combine="choice">
1421
<ref name="office-annotation"/>
1422
</define>
5.6 Index Marks
Index marks are used to mark text areas for inclusion into text indices. They are similar in
structure to bookmarks and references. They are discussed in detail section 7.1, together with
text indices.
5.7 Change Tracking and Change Marks
Paragraphs may also contain change tracking marks. These have already been explained in the
chapter on change tracking (section 4.6), and are referenced here for completeness.
1423
<define name="paragraph-content" combine="choice">
1424
<ref name="change-marks"/>
1425
</define>
5.8 Inline graphics and text-boxes
Within text documents, images, embedded objects and other drawing objects may be anchored
to a paragraph, to a character, or as an character. If they are anchored to a paragraph, they
appear within a paragraph at an arbitrary position. If they are anchored to or as a character, they
appear within a paragraph at exactly the character position they are anchored to or as. See
section 9.2 for details on drawing objects, and section 9.2.16 for their anchoring.
1426
<define name="paragraph-content" combine="choice">
1427
<choice>
1428
<ref name="shape"/>
1429
<ref name="draw-a"/>
1430
</choice>
1431
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 94 of 706

6 Text Fields
OpenDocument text documents or OpenDocument text content embedded in other types of
documents can contain variable text elements called fields. There are several different types of
field, each of which implements a different type of variable text element. Fields are most
commonly used for:

Page numbers
A page number field displays the number of the page it appears on. This field is useful for
footers. For every page on which the footer appears, the field assumes the current page
number so that all pages are numbered correctly.

Creation dates
A creation date field displays the date on which the current document was created. This field
is useful for document templates. Every document created using the template contains the
date when it was created.

Number ranges
A number range field allows the user to number certain elements, for example, images or
tables. A number range field displays its own position in relation to the other number range
fields for the same range. Therefore, if an image and its associated number range field are
moved within a document, the fields are automatically updated to reflect the new order.
This section describes how fields are represented in the OpenDocument file format.
6.1 Common Characteristics of Field Elements
Each field type is represented by a corresponding element type. A field in a document is
encoded as a single element of the appropriate type. The content of the element is the textual
representation of the current field value as it would be displayed or printed. Therefore, ignoring
all field elements and displaying only the textual content of the elements provides an
approximate text-only version of the document.
The value of a field is usually stored in an attribute. It is necessary to store the value so that the
presentation of the field can be recomputed if necessary, for example, if the user decides to
change the formatting style of the field. It is also necessary to store the presentation style of the
element content, to facilitate easy processing of the XML document. For example, if complete
processing of a field is impossible or undesirable, the application can ignore the field and use
only the content in this situation. For string values, if the value is identical to the presentation,
the value attribute is omitted to avoid duplicate storage of information.
For fields that can store different types of content, for example, numbers, strings, or dates, a
value type is stored in addition to the actual value. The value and value type attributes are
explained later in section 6.7.1. If more information is needed to restore a field, it is stored in
additional attributes.
The most common attributes of field elements are:

Fixed fields
Many fields have a variant where the content does not change after the initial value is
assigned. These fields are generally marked by the attribute text:fixed. See section 6.7.2
for more information on this attribute.

Formatting style
Several field types, particularly those representing number, date, or time data, contain a
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 95 of 706

formatting style. In the OpenDocument format, this formatting style is represented by a
style:data-style-name attribute. Since the user can change the presentation style for
fields, applications must be able to recompute a new representation of the field content at
any time. See section 6.7.7 for more information on this attribute.
6.2 Document Fields
OpenDocument fields can display information about the current document or about a specific
part of the current document, such as the author, the current page number, or the document
creation date. These fields are collectively referred to as document fields.
Document fields are often fixed. A field can be marked fixed to indicate that its content is
preserved, rather than re-evaluated, when the document is edited. For example, a date field
shows the current date. If the date field is marked fixed, the value of the field is preserved during
subsequent edits and always reflects the original date on which the field was inserted into the
document. If the field is not marked fixed, its value changes whenever the document is edited. In
the same way, the author field can show the original author or the last author of a document,
depending on whether the field is marked fixed or not.
The group of document fields includes:

Date and time fields

Page number fields

Sender and author fields

Chapter fields

File name fields

Document template fields
6.2.1 Date Fields
Date fields display the current date. The date can be adjusted to display a date other than the
current date. For example, the date can be changed on a document that was edited late at night
so that it displays the date of the following day or several days later.
This element contains the presentation of the date field value, depending on the data style
specified. The default date is the current date. The value of this element can be preserved using
the text:fixed attribute described in section 6.7.2.
1432
<define name="paragraph-content" combine="choice">
1433
<element name="text:date">
1434
<ref name="text-date-attlist"/>
1435
<text/>
1436
</element>
1437
</define>
The attributes that may be associated with the <text:date> element are:

Date value

Date adjustment

Fixed (see section 6.7.2)

Formatting style (see section 6.7.7). The formatting style must be a date data style, see
section 14.7 for more information.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 96 of 706

1438
<define name="text-date-attlist" combine="interleave">
1439
<interleave>
1440
<ref name="common-field-fixed-attlist"/>
1441
<ref name="common-field-data-style-name-attlist"/>
1442
</interleave>
1443
</define>
Date Value
The text:date-value attribute specifies a particular date value. For example, if the date field
is marked fixed, this attribute can be used to specify the date on which the field was marked as
fixed. This attribute can also be used to specify a future date. Some applications support date
and time in addition to date-only values.
The date value should conform with the date formats described in §3.2.7 and §3.2.9 of
[xmlschema-2]. If no value is specified, the current date is assumed, even if the field is marked
fixed.
1444
<define name="text-date-attlist" combine="interleave">
1445
<optional>
1446
<attribute name="text:date-value">
1447
<ref name="dateOrDateTime"/>
1448
</attribute>
1449
</optional>
1450
</define>
Date Adjustment
The value of a date field can be adjusted by a certain time period, which is specified using the
text:date-adjust attribute. If the time period is negative, it gets subtracted from the value of
the date field, yielding a date before the current date.
The value of this attribute must conform to the time period format described in §3.2.6 of
[xmlschema-2]. The value can be preceded by an optional minus sign to indicate a negative time
duration.
1451
<define name="text-date-attlist" combine="interleave">
1452
<optional>
1453
<attribute name="text:date-adjust">
1454
<ref name="duration"/>
1455
</attribute>
1456
</optional>
1457
</define>
6.2.2 Time Fields
Time fields display the current time. They are very similar to the date fields described in the
previous section, supporting the same attributes except that for time fields, they are called
text:time-value and text:time-adjust attributes.
This element contains the presentation of the time field value, depending on the data style
specified. The default time is the current time. The value of this element can be preserved using
the text:fixed attribute described in section 6.7.2.
1458
<define name="paragraph-content" combine="choice">
1459
<element name="text:time">
1460
<ref name="text-time-attlist"/>
1461
<text/>
1462
</element>
1463
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 97 of 706

The attributes that may be associated with the <text:time> element are:

Time value

Time adjustment

Fixed (see section 6.7.2)

Formatting style (see section 6.7.7). The formatting style must be a time data style, see
section 14.7 for more information.
1464
<define name="text-time-attlist" combine="interleave">
1465
<interleave>
1466
<ref name="common-field-fixed-attlist"/>
1467
<ref name="common-field-data-style-name-attlist"/>
1468
</interleave>
1469
</define>
Time Value
The text:time-value attribute records the time at which the document was last edited.
Some applications support date and time in addition to date-only values.
The value of this attribute must conform with either the “dateTime” or “time” data types described
in §3.2.7 and §3.2.8 of [xmlschema-2]. If no value is specified, the current time is assumed,
even if the field is marked fixed.
1470
<define name="text-time-attlist" combine="interleave">
1471
<optional>
1472
<attribute name="text:time-value">
1473
<ref name="timeOrDateTime"/>
1474
</attribute>
1475
</optional>
1476
</define>
Time Adjustment
The value of a time field can be adjusted by a certain time period, which is specified using the
text:time-adjust attribute.
The value of this attribute must conform to the time period format described in §3.2.6 of
[xmlschema-2]. The value can be preceded by an optional minus sign to indicate a negative time
duration. Positive values adjust the time to a time in the future, while negative values adjust the
time to a time in the past. The duration is truncated to full minutes.
1477
<define name="text-time-attlist" combine="interleave">
1478
<optional>
1479
<attribute name="text:time-adjust">
1480
<ref name="duration"/>
1481
</attribute>
1482
</optional>
1483
</define>
Example: Time adjust attributes and their effects
If the attribute text:time-adjust="PTM15", the time field displays a time which is 15
minutes later than the actual time specified by the time field value.
If the attribute text:time-adjust="-PTH1", the time field displays a time which is one
hour before the actual time specified by the time field value.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 98 of 706

6.2.3 Page Number Fields
Page number fields display the current page number. These fields are particularly useful in
headers and footers. E.g., if a page number field is inserted into a footer, the current page
number is displayed on every page on which the footer appears.
The attributes that may be associated with the <text:page-number> element are:

Page adjustment

Display previous or following page numbers

Fixed (see section 6.7.2)

Formatting style (see section 6.7.8)
Page numbers can be formatted according to the number format described in section 2.9. If
a number style is not specified, the page numbers are formatted according to the number
style defined in the current page style.
1484
<define name="paragraph-content" combine="choice">
1485
<element name="text:page-number">
1486
<ref name="text-page-number-attlist"/>
1487
<text/>
1488
</element>
1489
</define>
1490
<define name="text-page-number-attlist" combine="interleave">
1491
<interleave>
1492
<ref name="common-field-num-format-attlist"/>
1493
<ref name="common-field-fixed-attlist"/>
1494
</interleave>
1495
</define>
Note: To display the total number of pages in a document, use the
<text:page-count/> field described in section 6.4.17.
Page Adjustment
The value of a page number field can be adjusted by a specified number, allowing the display of
page numbers of following or preceding pages. The adjustment amount is specified using the
text:page-adjust attribute. When this attribute is used, the application:
1. Adds the value of the attribute to the current page number.
2. Checks to see if the resulting page exists.
3. If the page exists, the number of that page is displayed.
4. If the page does not exist, the value of the page number field remains empty and no number
is displayed.
1496
<define name="text-page-number-attlist" combine="interleave">
1497
<optional>
1498
<attribute name="text:page-adjust">
1499
<ref name="integer"/>
1500
</attribute>
1501
</optional>
1502
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 99 of 706

Display Previous or Following Page Numbers
The text:select-page attribute is used to display the number of the previous or the following
page rather than the number of the current page.
1503
<define name="text-page-number-attlist" combine="interleave">
1504
<optional>
1505
<attribute name="text:select-page">
1506
<choice>
1507
<value>previous</value>
1508
<value>current</value>
1509
<value>next</value>
1510
</choice>
1511
</attribute>
1512
</optional>
1513
</define>
Note: To display the current page number on all pages except the first or last
page, use a combination of the text:select page and text:page adjust
attributes.
Example: Displaying the current page number on all pages except the first page
<text:page-number text:select-page="previous"
text:page-adjust="1"
style:num-format="1"/>
6.2.4 Page Continuation Text
In some publications, a continuation reminder is printed at the bottom of the page in addition to
the page number. To include a continuation reminder, use the <text:page-continuation>
element.
1514
<define name="paragraph-content" combine="choice">
1515
<element name="text:page-continuation">
1516
<ref name="text-page-continuation-attlist"/>
1517
<text/>
1518
</element>
1519
</define>
The attributes associated with the <text:page-continuation> element are:

Previous or following page

String value
Previous or Following Page
This attribute specifies whether to check for a previous or next page and if the page exists, the
continuation text is printed.
1520
<define name="text-page-continuation-attlist" combine="interleave">
1521
<attribute name="text:select-page">
1522
<choice>
1523
<value>previous</value>
1524
<value>next</value>
1525
</choice>
1526
</attribute>
1527
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 100 of 706

String Value
This attribute specifies the continuation text to display. If this attribute is omitted, the element
content is used.
1528
<define name="text-page-continuation-attlist" combine="interleave">
1529
<optional>
1530
<attribute name="text:string-value">
1531
<ref name="string"/>
1532
</attribute>
1533
</optional>
1534
</define>
6.2.5 Sender Fields
There are several fields which contain information about the sender of the current document, for
example, name and email address. The information about the sender is taken from the
OpenDocument user information dialog. If a sender field is marked fixed using the text:fixed
attribute, the original sender information in the sender fields is preserved. (cf. section 6.7.2)
Otherwise, the information is updated each time the file is edited, causing the fields to change
value when the document is edited by a different user.
First Name
This element represents the first name of the sender.
1535
<define name="paragraph-content" combine="choice">
1536
<element name="text:sender-firstname">
1537
<ref name="common-field-fixed-attlist"/>
1538
<text/>
1539
</element>
1540
</define>
Last Name
This element represents the last name of the sender.
1541
<define name="paragraph-content" combine="choice">
1542
<element name="text:sender-lastname">
1543
<ref name="common-field-fixed-attlist"/>
1544
<text/>
1545
</element>
1546
</define>
Initials
This element represents the initials of the sender.
1547
<define name="paragraph-content" combine="choice">
1548
<element name="text:sender-initials">
1549
<ref name="common-field-fixed-attlist"/>
1550
<text/>
1551
</element>
1552
</define>
Title
This element represents the title of the sender.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 101 of 706

1553
<define name="paragraph-content" combine="choice">
1554
<element name="text:sender-title">
1555
<ref name="common-field-fixed-attlist"/>
1556
<text/>
1557
</element>
1558
</define>
Position
This element represents the position of the sender.
1559
<define name="paragraph-content" combine="choice">
1560
<element name="text:sender-position">
1561
<ref name="common-field-fixed-attlist"/>
1562
<text/>
1563
</element>
1564
</define>
Email Address
This element represents the email address of the sender.
1565
<define name="paragraph-content" combine="choice">
1566
<element name="text:sender-email">
1567
<ref name="common-field-fixed-attlist"/>
1568
<text/>
1569
</element>
1570
</define>
Private Telephone Number
This element represents the private telephone number of the sender.
1571
<define name="paragraph-content" combine="choice">
1572
<element name="text:sender-phone-private">
1573
<ref name="common-field-fixed-attlist"/>
1574
<text/>
1575
</element>
1576
</define>
Fax Number
This element represents the facsimile number of the sender.
1577
<define name="paragraph-content" combine="choice">
1578
<element name="text:sender-fax">
1579
<ref name="common-field-fixed-attlist"/>
1580
<text/>
1581
</element>
1582
</define>
Company Name
This element represents the name of the company that employs the sender.
1583
<define name="paragraph-content" combine="choice">
1584
<element name="text:sender-company">
1585
<ref name="common-field-fixed-attlist"/>
1586
<text/>
1587
</element>
1588
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 102 of 706

Office Telephone Number
This element represents the office telephone number of the sender.
1589
<define name="paragraph-content" combine="choice">
1590
<element name="text:sender-phone-work">
1591
<ref name="common-field-fixed-attlist"/>
1592
<text/>
1593
</element>
1594
</define>
Street
This element represents the street name of the address of the sender.
1595
<define name="paragraph-content" combine="choice">
1596
<element name="text:sender-street">
1597
<ref name="common-field-fixed-attlist"/>
1598
<text/>
1599
</element>
1600
</define>
City
This element represents the city name of the address of the sender.
1601
<define name="paragraph-content" combine="choice">
1602
<element name="text:sender-city">
1603
<ref name="common-field-fixed-attlist"/>
1604
<text/>
1605
</element>
1606
</define>
Postal Code
This element represents the postal code of the address of the sender.
1607
<define name="paragraph-content" combine="choice">
1608
<element name="text:sender-postal-code">
1609
<ref name="common-field-fixed-attlist"/>
1610
<text/>
1611
</element>
1612
</define>
Country
This element represents the country of the address of the sender.
1613
<define name="paragraph-content" combine="choice">
1614
<element name="text:sender-country">
1615
<ref name="common-field-fixed-attlist"/>
1616
<text/>
1617
</element>
1618
</define>
State or Province
This element represents the state or province of the address of the sender, if applicable.
1619
<define name="paragraph-content" combine="choice">
1620
<element name="text:sender-state-or-province">
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 103 of 706

1621
<ref name="common-field-fixed-attlist"/>
1622
<text/>
1623
</element>
1624
</define>
6.2.6 Author Fields
There are two elements available to display the author of a document. One element displays the
full name of the author and the other element displays the initials of the author.
The value of author fields can be fixed using the text:fixed attribute. Marking an author field
as fixed preserves the original field content. Otherwise, the field content changes each time the
document is updated, to reflect the last author of the document.
Name of the Author
This element represents the full name of the author.
1625
<define name="paragraph-content" combine="choice">
1626
<element name="text:author-name">
1627
<ref name="common-field-fixed-attlist"/>
1628
<text/>
1629
</element>
1630
</define>
Initials of the Author
This element represents the initials of the author.
1631
<define name="paragraph-content" combine="choice">
1632
<element name="text:author-initials">
1633
<ref name="common-field-fixed-attlist"/>
1634
<text/>
1635
</element>
1636
</define>
6.2.7 Chapter Fields
Chapter fields display one of the following:

The name of the current chapter

The number of the current chapter

Both the name and number of the current chapter
If the chapter field is placed inside a header or footer, it displays the current chapter name or
number on every page.
1637
<define name="paragraph-content" combine="choice">
1638
<element name="text:chapter">
1639
<ref name="text-chapter-attlist"/>
1640
<text/>
1641
</element>
1642
</define>
The attributes that may be associated with the <text:chapter> element are:

Display

Outline level
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 104 of 706

Display
The text:display attribute specifies the information that the chapter field should display.
1643
<define name="text-chapter-attlist" combine="interleave">
1644
<attribute name="text:display">
1645
<choice>
1646
<value>name</value>
1647
<value>number</value>
1648
<value>number-and-name</value>
1649
<value>plain-number-and-name</value>
1650
<value>plain-number</value>
1651
</choice>
1652
</attribute>
1653
</define>
Example: If the current chapter number is 2.4, the chapter title is Working with Tables, the prefix
is [, and suffix is ], the possible display options and results are as follows:
Value of text:display
Field content
attribute
displayed
number
[2.4]
name
Working with Tables
number-and-name
[2.4] Working with
Tables
plain-number
2.4
plain-number-and-name
2.4 Working with Tables
Outline Level
This attribute is used to specify the outline level to use. The chapter field displays the chapter
number or title up to the specified outline level.
1654
<define name="text-chapter-attlist" combine="interleave">
1655
<attribute name="text:outline-level">
1656
<ref name="nonNegativeInteger"/>
1657
</attribute>
1658
</define>
6.2.8 File Name Fields
File name fields display the name of the file that is currently being edited.
The attributes that may be associated with the <text:file-name> element are:

Display

Fixed
1659
<define name="paragraph-content" combine="choice">
1660
<element name="text:file-name">
1661
<ref name="text-file-name-attlist"/>
1662
<text/>
1663
</element>
1664
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 105 of 706

Display
The text:display attribute specifies how much of the file name to display. The following
display options are allowed:

The full file name including the path and the extension

The file path only

The file name only

The file name and the extension
The filename might be an URI, either because an URI has been used to retrieve the file, or the
application internally uses URIs and therefor converts even system specific paths into an URI. If
this is the case, and if the the path, the name or the extension cannot be evaluated from the URI,
then the URI should be displayed unmodified.
1665
<define name="text-file-name-attlist" combine="interleave">
1666
<optional>
1667
<attribute name="text:display">
1668
<choice>
1669
<value>full</value>
1670
<value>path</value>
1671
<value>name</value>
1672
<value>name-and-extension</value>
1673
</choice>
1674
</attribute>
1675
</optional>
1676
</define>
Fixed File Name Fields
If a file name field is fixed, its value does not change when the file is edited.
1677
<define name="text-file-name-attlist" combine="interleave">
1678
<ref name="common-field-fixed-attlist"/>
1679
</define>
6.2.9 Document Template Name Fields
The document template name field displays information about the document template in use,
such as the template title or the file name.
The only attribute that may be associated with the <text:template-name> element is:

Display
1680
<define name="paragraph-content" combine="choice">
1681
<element name="text:template-name">
1682
<ref name="text-template-name-attlist"/>
1683
<text/>
1684
</element>
1685
</define>
Display
This attribute specifies which information about the document template to display. The following
display options are allowed:

The full file name including the path and the extension
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 106 of 706


The file path only

The file name only

The file name and the extension

The title

The area of the document template
The latter two values can be used for template dialogs. The values are a superset of the display
values available for the <text:file-name> element.
1686
<define name="text-template-name-attlist">
1687
<optional>
1688
<attribute name="text:display">
1689
<choice>
1690
<value>full</value>
1691
<value>path</value>
1692
<value>name</value>
1693
<value>name-and-extension</value>
1694
<value>area</value>
1695
<value>title</value>
1696
</choice>
1697
</attribute>
1698
</optional>
1699
</define>
6.2.10 Sheet Name Fields
For Spreadsheet documents, sheet name fields display the name of the sheet that is currently
being edited.
1700
<define name="paragraph-content" combine="choice">
1701
<element name="text:sheet-name">
1702
<text/>
1703
</element>
1704
</define>
6.3 Variable Fields
OpenDocument text documents can contain variables, which are processed or displayed using
variable fields. A variable is a name/value pair. The variable name is used throughout the
document to identify a particular variable, and therefore variable names cannot be reused for
different types of variables. Most variable fields support different value types, such as numbers,
dates, strings, and so on. In the OpenDocument file format, a variable must be declared at the
beginning of a document.
There are three types of variables:

Simple variables
Simple variables, usually called variables, can take different values at different positions
throughout a document. Simple variables can be set using either setter or input fields. Setter
fields contain an expression, which is used to compute the new value of the variable. Input
fields prompt the user for the new value. Simple variables can be used to display different
text in recurring elements, such as headers or footers.

User variables
User variables have the same value throughout a document. If a user variable is set
anywhere within the document, all fields in the document that display the user variable have
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 107 of 706

the same value. In the office application user interface, a user variable can be set at any
occurrence of a user field, or by using user variable input fields. In the OpenDocument file
format, the value of the user variable can only be set after the variable is declared.

Sequence variables
Sequence variables are used to number certain items in an OpenDocument text document,
for example, images or tables.
Expression and text input fields are also variable fields, but they are not associated with any
particular variables. Since their functionality is closely related to that of the variable fields, they
are also described in this section of the manual.
Variables must be declared before they can be used. The variable declarations are collected in
container elements for the particular variable type. The OpenDocument code for declaring
variables is described in the following section.
6.3.1 Declaring Simple Variables
Simple variables are declared using <text:variable-decl> elements. The declaration
specifies the name and the value type of the variable.
To specify the name and value type of the simple variable, the following attributes are attached
to the <text:variable-decl> element:

text:name
The name of the variable must be unique. The name cannot already be used for any other
type of variable. See section 6.7.3 for information on using this attribute.

office:value-type
See section 6.7.1 for information on using this attribute.
1705
<define name="text-variable-decl">
1706
<element name="text:variable-decl">
1707
<ref name="common-field-name-attlist"/>
1708
<ref name="common-value-type-attlist"/>
1709
</element>
1710
</define>
6.3.2 Setting Simple Variables
Simple variables can be set using variable setter elements. This element contains the
presentation of the value of the variable, which can be empty if the text:display attribute is
set to none.
The attributes that may be associated with the <text:variable-set> element are:

text:name
This attribute specifies the name of the variable to set. It must match the name of a variable
that has already been declared. See section 6.7.3 for information on using this attribute.

text:formula
This attribute contains the formula to compute the value of the variable field. If the formula
equals the content of the field element, this attribute can be omitted. See section 6.7.6 for
information on using this attribute.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 108 of 706


office:value-type and the appropriate value attribute
See section 6.7.1 for information on using these attributes.
Note: A simple variable should not contain different value types at different places in a
document. However, an implementation may allow the use of different value types for
different instances of the same variable. In the case of the numeric value types float,
percentage, and currency, the value is automatically converted to the different value
type. For value types that are stored internally as numbers, such as date, time, and
boolean types, the values are reinterpreted as numbers of the respective types. If a
variable is used for both string and non-string types, the behavior is undefined, therefore this
practice is not recommended.

text:display
This attribute can be used to specify whether or not to display the value of the
<text:variable-set> element. If the text:display attribute is set to value, the value
of the variable is displayed. If the attribute is set to none, the value is not displayed. See
section 6.7.5 for information on using this attribute.

style:data-style-name
This attribute specifies the data style to use to format a numeric, Boolean, or date/time
variable. If a data style is not specified, a standard data style is used. See section 6.7.7 for
information on using this attribute.
1711
<define name="paragraph-content" combine="choice">
1712
<element name="text:variable-set">
1713
<interleave>
1714
<ref name="common-field-name-attlist"/>
1715
<ref name="common-field-formula-attlist"/>
1716
<ref name="common-value-and-type-attlist"/>
1717
<ref name="common-field-display-value-none-attlist"/>
1718
<ref name="common-field-data-style-name-attlist"/>
1719
</interleave>
1720
<text/>
1721
</element>
1722
</define>
6.3.3 Displaying Simple Variables
The <text:variable-get> element reads and displays the value of a simple variable. The
value of this element is the value of the last preceding <text:variable-set> element with an
identical text:name attribute. The element determines how the value of the variable is
presented, in accordance with the chosen formatting style.
The attributes that may be associated with the <text:variable-get> element are:

text:name
This attribute specifies the name of the variable to display. The name must match the name
of a preceding <text:variable-del> element. See section 6.7.3 for information on using
this attribute.

text:display
This attribute can be used to specify whether to display the formula for a simple variable or
the computed value of the variable. See section 6.7.5 for information on using this attribute.

style:data-style-name
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 109 of 706

This attribute specifies the data style to use to format a numeric, Boolean, or date/time
variable. If a data style is not specified, a standard data style is used. See section 6.7.7 for
information on using this attribute.
1723
<define name="paragraph-content" combine="choice">
1724
<element name="text:variable-get">
1725
<interleave>
1726
<ref name="common-field-name-attlist"/>
1727
<ref name="common-field-display-value-formula-attlist"/>
1728
<ref name="common-field-data-style-name-attlist"/>
1729
</interleave>
1730
<text/>
1731
</element>
1732
</define>
6.3.4 Simple Variable Input Fields
As an alternative to setting simple variables using formulas in variable setter elements, the user
can be prompted for variable values. To do this, use the <text:variable-input> element.
This element contains the presentation of the variable's value according to the chosen formatting
style. The presentation can be empty if the text:display attribute is set to none.
The attributes that may be associated with the <text:variable-input> element are:

text:name
This attribute specifies the name of the variable to display. It must match the name of a
variable that was already declared. See section 6.7.3 for information on using this attribute.

text:description
This optional attribute contains a brief message that is presented to users when they are
prompted for input. The message should give users enough information about the variable or
the use of the value within the document to enable them to choose an appropriate value.
See section 6.7.4 for information on using this attribute.

office:value-type and the appropriate value attribute
See section 6.7.1 for information on using these attributes.

text:display
This attribute can be used to specify whether to display or hide the value of the variable
through the variable input field. See section 6.7.5 for information on using this attribute.

style:data-style-name
This attribute specifies the data style to use to format a numeric, Boolean, or date/time
variable. If a data style is not specified, a standard data style is used. See section 6.7.7 for
information on using this attribute.
1733
<define name="paragraph-content" combine="choice">
1734
<element name="text:variable-input">
1735
<interleave>
1736
<ref name="common-field-name-attlist"/>
1737
<ref name="common-field-description-attlist"/>
1738
<ref name="common-value-type-attlist"/>
1739
<ref name="common-field-display-value-none-attlist"/>
1740
<ref name="common-field-data-style-name-attlist"/>
1741
</interleave>
1742
<text/>
1743
</element>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 110 of 706

1744
</define>
6.3.5 Declaring User Variables
User variables contain values that are displayed using appropriate fields. Unlike simple
variables, user variables have the same value throughout a document. For this reason, the value
of user variables is stored in the variable declaration itself.
The attributes that may be associated with the <text:user-field-del> element are:

text:name
This attribute specifies the name of the variable to be declared. The name must be unique. It
cannot already be used for any other type of variable including simple and sequence
variables. See section 6.7.3 for information on using this attribute.

text:formula
This attribute contains the formula to compute the value of the user variable field. If the
formula is the same as the content of the field element, this attribute can be omitted. See
section 6.7.6 for information on using this attribute.

office:value-type and the appropriate value attribute
See section 6.7.1 for information on using these attributes.
1745
<define name="text-user-field-decl">
1746
<element name="text:user-field-decl">
1747
<ref name="common-field-name-attlist"/>
1748
<optional>
1749
<ref name="common-field-formula-attlist"/>
1750
</optional>
1751
<ref name="common-value-and-type-attlist"/>
1752
</element>
1753
</define>
6.3.6 Displaying User Variables
The content of user variables can be displayed using <text:user-field-get> elements.
The attributes that may be associated with the <text:user-field-get> element are:

text:name
This attribute specifies the name of the variable to display. The name must match the name
of a preceding <text:user-field-del> element. See section 6.7.3 for information on
using this attribute.

text:display
This attribute can be used to specify whether to:

Display the formula used to compute the value of the user variable.

Display the value of the user variable.

Hide the user variable fields.

See section 6.7.5 for information on using this attribute.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 111 of 706

Note: Since the office application user interfaces usually allow users to edit a user field
variable by clicking on any user field, a hidden <text:user-field-get> element can be
used as an anchor to allow easy access to a particular user field variable.

style:data-style-name
This attribute specifies the data style to use to format a numeric, Boolean, or date/time
variable. If a data style is not specified, a standard data style is used. See section 6.7.7 for
information on using this attribute.
1754
<define name="paragraph-content" combine="choice">
1755
<element name="text:user-field-get">
1756
<interleave>
1757
<ref name="common-field-name-attlist"/>
1758
<ref name="common-field-display-value-formula-none-attlist"/>
1759
<ref name="common-field-data-style-name-attlist"/>
1760
</interleave>
1761
<text/>
1762
</element>
1763
</define>
6.3.7 User Variable Input Fields
An alternative method of setting user variables is to use input fields, similar to the input fields for
simple variables. A user variable can be set in this way using the <text:user-field-input>
element. Since the value of a user field variable is stored in the <text:user-field-del>
element, the <text:user-field-input> element does not contain the value and value type
attributes from the <text:variable-input> field.
The presentation can be empty if the text:display attribute is set to none.
The attributes that may be associated with the <text:user-field-input> element are:

text:name
This attribute specifies the name of the variable to set. It must match the name of a variable
that has already been declared. See section 6.7.3 for information on using this attribute.

text:description
This optional attribute contains a brief message that is presented to users when they are
prompted for input. The message should give users enough information about the variable or
the use of the value within the document, to enable them to choose an appropriate value.
See section 6.7.4 for information on using this attribute.

style:data-style-name
This attribute specifies the data style to use to format a numeric, Boolean, or date/time
variable. If a data style is not specified, a standard data style is used. See section 6.7.7 for
information on using this attribute.
1764
<define name="paragraph-content" combine="choice">
1765
<element name="text:user-field-input">
1766
<interleave>
1767
<ref name="common-field-name-attlist"/>
1768
<ref name="common-field-description-attlist"/>
1769
<ref name="common-field-data-style-name-attlist"/>
1770
</interleave>
1771
<text/>
1772
</element>
1773
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 112 of 706

6.3.8 Declaring Sequence Variables
Sequence variables are used to number items within an OpenDocument text document.
Sequence variables are most commonly used for sequential numbering. However, expression
formulas can be included in sequence fields to support more advanced sequences. See section
6.3.9 for more information on Using Sequence Fields and their uses.
Sequence variables are declared using the <text:sequence-del> element.
To facilitate chapter-specific numbering, attributes can be attached to a sequence variable to
specify a chapter level and a separation character. The attributes that may be associated with
the <text:sequence-del> element are:

text:name
This attribute specifies the name of the variable to be declared. The name must be unique. It
cannot already be used for any other type of variable including simple and user variables.
See section 6.7.3 for information on using this attribute.

text:display-outline-level
See following section Outline Level for information about this attribute.

text:separation-character
See following section Separation Character for information about this attribute.
1774
<define name="text-sequence-decl">
1775
<element name="text:sequence-decl">
1776
<ref name="text-sequence-decl-attlist"/>
1777
</element>
1778
</define>
1779
<define name="text-sequence-decl-attlist" combine="interleave">
1780
<ref name="common-field-name-attlist"/>
1781
</define>
Outline Level
Sequences can be numbered by chapter. To use this feature, use the text:display-
outline-level attribute to specify an outline level that determines which chapters to reference
for the chapter-specific numbering. All chapters that are at or below the specified outline level
reset the value of the sequence to zero, the default value. Also, the chapter number of the last
chapter at or below the specified outline level is prepended to the sequence number. Choosing
an outline level of zero results in a straight sequence of all sequence elements for that sequence
variable.
1782
<define name="text-sequence-decl-attlist" combine="interleave">
1783
<attribute name="text:display-outline-level">
1784
<ref name="nonNegativeInteger"/>
1785
</attribute>
1786
</define>
Separation Character
If sequences are numbered by chapter, this attribute is used to choose a character to separate
the chapter number from the sequence number.
If the value of the text:display-outline-level attribute is a non-zero value, a separation
character may be specified. The default separation character is ".".Otherwise, if the value of
text:display-outline-level is zero, this attribute must be omitted.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 113 of 706

1787
<define name="text-sequence-decl-attlist" combine="interleave">
1788
<optional>
1789
<attribute name="text:separation-character">
1790
<ref name="character"/>
1791
</attribute>
1792
</optional>
1793
</define>
Example: Sequence variable
The sequence variable 3.7.36#5 with a value of 5 is declared using:
Attribute
Value
text:display-outline-level 3
text:separation-character
#
6.3.9 Using Sequence Fields
Once a sequence variable is declared, it can be used in sequence fields throughout the
document. Most sequence fields simply increment and display the sequence variable. However,
sequence fields can also assume a new start value at any given position in a document. This
start value is computed using a formula which is contained in the sequence field. If a sequence
field without a start value is added, the office application software automatically inserts an
expression of the type variable+1.
Sequence fields are most commonly used for simple counting sequences. However, the ability to
provide arbitrary expressions supports more complex sequences. To form a sequence of even
numbers, all sequence elements for that particular variable need to contain a formula
incrementing the value by two, for example, variable+2. A sequence with a starting value of 1
and all subsequent elements using the formula variable*2 yields all powers of two. Since
different sequence elements for the same sequence variable may contain different formulas,
complex sequences may be constructed.
The attributes that may be associated with the <text:sequence> element are:

text:name
This attribute specifies the name of the variable that the field is to display. It must match the
name of a sequence variable that was already declared. See section 6.7.3 for information on
using this attribute.

text:formula
This optional attribute contains a formula to compute the value of the sequence field. If this
attribute is omitted, an expression containing the content of the element is used. See section
6.7.6 for information on using this attribute.

style:num-format and style:num-letter-sync
These attributes specify the numbering style to use. If a numbering style is not specified, the
numbering style is inherited from the page style. See section 6.7.8 for information on these
attributes.

text:ref-name
See the fol owing section Reference Name for more information about this attribute.
1794
<define name="paragraph-content" combine="choice">
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 114 of 706

1795
<element name="text:sequence">
1796
<interleave>
1797
<ref name="common-field-name-attlist"/>
1798
<ref name="common-field-formula-attlist"/>
1799
<ref name="common-field-num-format-attlist"/>
1800
<ref name="text-sequence-ref-name"/>
1801
</interleave>
1802
<text/>
1803
</element>
1804
</define>
Reference Name
Sequence fields can be the target of references, as implemented using reference fields. See
section 6.6.5 for more information about reference fields. To enable a reference field to identify a
particular sequence field, the sequence field must contain an additional attribute containing a
name. No two sequence fields can have the same reference name.
If the sequence field is not the target of a reference, this attribute can be omitted.
1805
<define name="text-sequence-ref-name">
1806
<optional>
1807
<attribute name="text:ref-name">
1808
<ref name="string"/>
1809
</attribute>
1810
</optional>
1811
</define>
6.3.10 Expression Fields
Expression fields contain expressions that are evaluated and the resulting value is displayed.
The value of the expression is formatted according to the chosen formatting style.
The attributes that may be associated with the <text:expression> element are:

text:formula
This attribute contains the actual expression used to compute the value of the expression
field. See section 6.7.6 for information on using this attribute.

office:value-type and the appropriate value attribute
See section 6.7.1 for information on using these attributes.

text:display
Use this attribute to specify one of the following:

To display the value of the field.

To display the formula used to compute the value.
See section 6.7.5 for information on using this attribute.

style:data-style-name
This attribute specifies the data style to use to format a numeric, Boolean, or date/time
variable. If a data style is not specified, a standard data style is used. See section 6.7.7 for
information on using this attribute.
1812
<define name="paragraph-content" combine="choice">
1813
<element name="text:expression">
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 115 of 706

1814
<interleave>
1815
<ref name="common-field-formula-attlist"/>
1816
<optional>
1817
<ref name="common-value-and-type-attlist"/>
1818
</optional>
1819
<ref name="common-field-display-value-formula-attlist"/>
1820
<ref name="common-field-data-style-name-attlist"/>
1821
</interleave>
1822
<text/>
1823
</element>
1824
</define>
6.3.11 Text Input Fields
A text input field is a variable field. From the point of view of the user interface, a text input field
is similar to the <text:variable-input> and <text:user-field-input> fields. However,
the text input field does not change the value of any variables.
The only attribute that may be associated with the <text:text-input> element is:

text:description
This attribute contains a brief message that is presented to users when they are prompted for
input. The message should give users enough information about the purpose of the field and
how it is used within the document, to enable them to choose an appropriate value. See
section 6.7.4 for information on using this attribute.
1825
<define name="paragraph-content" combine="choice">
1826
<element name="text:text-input">
1827
<ref name="common-field-description-attlist"/>
1828
<text/>
1829
</element>
1830
</define>
6.4 Metadata Fields
Metadata fields display meta information about the document, such as, the document creation
date or the time at which the document was last printed. The names of the metadata field
elements correspond to the metadata elements described in Chapter 3.
All metadata field elements can be marked as fixed using the text:fixed attribute. (Cf. section
6.7.2)
Several metadata fields display a date or a time. The elements for these fields require an
associated text:date-value or a text:time-value attribute, and optionally, they can also
have a style:data-style-name attribute. See section 6.7.1 for more information on these
attributes.
6.4.1 Initial Creator
This element represents the name of the author who created the original document.
1831
<define name="paragraph-content" combine="choice">
1832
<element name="text:initial-creator">
1833
<ref name="common-field-fixed-attlist"/>
1834
<text/>
1835
</element>
1836
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 116 of 706

6.4.2 Document Creation Date
This element represents the date on which the document was created.
1837
<define name="paragraph-content" combine="choice">
1838
<element name="text:creation-date">
1839
<interleave>
1840
<ref name="common-field-fixed-attlist"/>
1841
<ref name="common-field-data-style-name-attlist"/>
1842
<optional>
1843
<attribute name="text:date-value">
1844
<ref name="dateOrDateTime"/>
1845
</attribute>
1846
</optional>
1847
</interleave>
1848
<text/>
1849
</element>
1850
</define>
6.4.3 Document Creation Time
This element represents the time at which the document was created.
1851
<define name="paragraph-content" combine="choice">
1852
<element name="text:creation-time">
1853
<interleave>
1854
<ref name="common-field-fixed-attlist"/>
1855
<ref name="common-field-data-style-name-attlist"/>
1856
<optional>
1857
<attribute name="text:time-value">
1858
<ref name="timeOrDateTime"/>
1859
</attribute>
1860
</optional>
1861
</interleave>
1862
<text/>
1863
</element>
1864
</define>
6.4.4 Document Description
This element contains a brief description of the document.
1865
<define name="paragraph-content" combine="choice">
1866
<element name="text:description">
1867
<ref name="common-field-fixed-attlist"/>
1868
<text/>
1869
</element>
1870
</define>
6.4.5 User-Defined Document Information
This element contains user-defined information about the document. It displays the information
provided within a <meta:user-defined> element that has the same name.
1871
<define name="paragraph-content" combine="choice">
1872
<element name="text:user-defined">
1873
<interleave>
1874
<ref name="common-field-fixed-attlist"/>
1875
<attribute name="text:name">
1876
<ref name="string"/>
1877
</attribute>
1878
<ref name="common-field-data-style-name-attlist"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 117 of 706

1879
<optional>
1880
<attribute name="office:value">
1881
<ref name="double"/>
1882
</attribute>
1883
</optional>
1884
<optional>
1885
<attribute name="office:date-value">
1886
<ref name="dateOrDateTime"/>
1887
</attribute>
1888
</optional>
1889
<optional>
1890
<attribute name="office:time-value">
1891
<ref name="duration"/>
1892
</attribute>
1893
</optional>
1894
<optional>
1895
<attribute name="office:boolean-value">
1896
<ref name="boolean"/>
1897
</attribute>
1898
</optional>
1899
<optional>
1900
<attribute name="office:string-value">
1901
<ref name="string"/>
1902
</attribute>
1903
</optional>
1904
</interleave>
1905
<text/>
1906
</element>
1907
</define>
6.4.6 Print Time
This element represents the time at which the document was last printed.
1908
<define name="paragraph-content" combine="choice">
1909
<element name="text:print-time">
1910
<interleave>
1911
<ref name="common-field-fixed-attlist"/>
1912
<ref name="common-field-data-style-name-attlist"/>
1913
<optional>
1914
<attribute name="text:time-value">
1915
<ref name="time"/>
1916
</attribute>
1917
</optional>
1918
</interleave>
1919
<text/>
1920
</element>
1921
</define>
6.4.7 Print Date
This element represents the date on which the document was last printed.
1922
<define name="paragraph-content" combine="choice">
1923
<element name="text:print-date">
1924
<interleave>
1925
<ref name="common-field-fixed-attlist"/>
1926
<ref name="common-field-data-style-name-attlist"/>
1927
<optional>
1928
<attribute name="text:date-value">
1929
<ref name="date"/>
1930
</attribute>
1931
</optional>
1932
</interleave>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 118 of 706

1933
<text/>
1934
</element>
1935
</define>
6.4.8 Printed By
This element represents name of the last person who printed the document.
1936
<define name="paragraph-content" combine="choice">
1937
<element name="text:printed-by">
1938
<ref name="common-field-fixed-attlist"/>
1939
<text/>
1940
</element>
1941
</define>
6.4.9 Document Title
This element represents the title of the document.
1942
<define name="paragraph-content" combine="choice">
1943
<element name="text:title">
1944
<ref name="common-field-fixed-attlist"/>
1945
<text/>
1946
</element>
1947
</define>
6.4.10 Document Subject
This element represents the subject of the document.
1948
<define name="paragraph-content" combine="choice">
1949
<element name="text:subject">
1950
<ref name="common-field-fixed-attlist"/>
1951
<text/>
1952
</element>
1953
</define>
6.4.11 Document Keywords
This element contains a list of keywords used to describe the document.
1954
<define name="paragraph-content" combine="choice">
1955
<element name="text:keywords">
1956
<ref name="common-field-fixed-attlist"/>
1957
<text/>
1958
</element>
1959
</define>
6.4.12 Document Revision Number
This element contains the document revision number. When the document is created, the
revision number is set to 1. Each time the document is saved, the document revision number is
incremented.
1960
<define name="paragraph-content" combine="choice">
1961
<element name="text:editing-cycles">
1962
<ref name="common-field-fixed-attlist"/>
1963
<text/>
1964
</element>
1965
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 119 of 706

Note: Since the <text:editing-cycles> field can not be formatted, the
revision number can be read from the element content. Therefore, no extra
attribute is needed.
6.4.13 Document Edit Duration
Every time a document is edited, the office application records the duration between the time the
document is opened and the time the document is closed. It then adds the duration to an internal
counter, thereby keeping track of the total time that has been spent editing the document.
1966
<define name="paragraph-content" combine="choice">
1967
<element name="text:editing-duration">
1968
<interleave>
1969
<ref name="common-field-fixed-attlist"/>
1970
<ref name="common-field-data-style-name-attlist"/>
1971
<optional>
1972
<attribute name="text:duration">
1973
<ref name="duration"/>
1974
</attribute>
1975
</optional>
1976
</interleave>
1977
<text/>
1978
</element>
1979
</define>
6.4.14 Document Modification Time
This element represents the time at which the document was last modified.
This element displays the information from the <meta:date> element. The name was chosen
to avoid confusion with <text:date> fields.
1980
<define name="paragraph-content" combine="choice">
1981
<element name="text:modification-time">
1982
<interleave>
1983
<ref name="common-field-fixed-attlist"/>
1984
<ref name="common-field-data-style-name-attlist"/>
1985
<optional>
1986
<attribute name="text:time-value">
1987
<ref name="time"/>
1988
</attribute>
1989
</optional>
1990
</interleave>
1991
<text/>
1992
</element>
1993
</define>
6.4.15 Document Modification Date
This element represents the date on which the document was last modified.
This element displays the information from the <meta:date> element. The name was chosen
to avoid confusion with <text:date> fields.
1994
<define name="paragraph-content" combine="choice">
1995
<element name="text:modification-date">
1996
<interleave>
1997
<ref name="common-field-fixed-attlist"/>
1998
<ref name="common-field-data-style-name-attlist"/>
1999
<optional>
2000
<attribute name="text:date-value">
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 120 of 706

2001
<ref name="date"/>
2002
</attribute>
2003
</optional>
2004
</interleave>
2005
<text/>
2006
</element>
2007
</define>
6.4.16 Document Modified By
This element represents the name of the person who last modified the document.
2008
<define name="paragraph-content" combine="choice">
2009
<element name="text:creator">
2010
<ref name="common-field-fixed-attlist"/>
2011
<text/>
2012
</element>
2013
</define>
6.4.17 Document Statistics Fields
These fields display how many objects of a certain type a document contains. They can be used
to display the number of
• pages,
• paragraphs,
• words,
• characters,
• tables,
• images, or
• embedded objects.
2014
<define name="paragraph-content" combine="choice">
2015
<element>
2016
<choice>
2017
<name>text:page-count</name>
2018
<name>text:paragraph-count</name>
2019
<name>text:word-count</name>
2020
<name>text:character-count</name>
2021
<name>text:table-count</name>
2022
<name>text:image-count</name>
2023
<name>text:object-count</name>
2024
</choice>
2025
<ref name="common-field-num-format-attlist"/>
2026
<text/>
2027
</element>
2028
</define>
6.5 Database Fields
Documents can reference databases and display database information as text content. To
display database information, the OpenDocument schema uses a group of text fields,
collectively called database fields. Office applications may use database tables from SQL
servers, therefore database fields can be used to access any SQL database, provided that the
appropriate drivers are available.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 121 of 706

A database may contain the following components:

Tables, which store the actual data.

Queries, which extract a subset of data from one or more tables.

Forms, which present the data.

Reports, which summarize the database content.
Database forms and reports are not relevant to text content, therefore they are not discussed in
this chapter. From the point of view of embedding database information in OpenDocument text
documents, queries and tables are considered the same. Therefore for the remainder of this
section, the phrase database table refers to both database tables and database queries.
Database fields alone do not retrieve information from a database. In addition to the database
fields, a set of database rows is also added to the document. When new data is added to the
document, all database fields belonging to the added database table are updated. Using the
office application user interface, database rows can be added in one of the following ways:

Manually, using a data source browser and the data to fields function.

Using the Form Letter menu item on the File menu. This menu item adds each row in the
chosen data set into a newly created copy of the form letter.
To display data from a database table use the <text:database-display> element. The
<text:database-select> and <text:database-next> elements can be used to
determine which row within the current selection should be displayed. The current row number
for a particular table can be displayed using the <text:database-row-number> element.
Finally, the <text:database-name> field displays the name of the most recently used
database, which is the address book file database by default.
6.5.1 Database Field Data Source
A database field's source can either be the name of a database, or an URI containing database
connection resource data. If the source is a database name, then this name is used by all of the
office application components to identify a database. All database fields contain a database
name or connection resource, and most database fields also contain the name of a database
table, which must be stored in the database. An additional attribute determines whether the
database table refers to an SQL table, an OpenDocument query, or the result of a SQL
command.
2029
<define name="common-field-database-table">
2030
<ref name="common-field-database-table-attlist"/>
2031
<ref name="common-field-database-name"/>
2032
</define>
Database Name
The text:database-name attribute specifies the source database by its name.
2033
<define name="common-field-database-name" combine="choice">
2034
<optional>
2035
<attribute name="text:database-name">
2036
<ref name="string"/>
2037
</attribute>
2038
</optional>
2039
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 122 of 706

Connection Resource
The <form:connection-resource> element specifies the source database by an [XLink]. Its
xlink:href attribute either references a file containing a database, or it contains information
on how to make a connection to a database, for instance a [JDBC] URL. See also section
11.1.20.
2040
<define name="common-field-database-name" combine="choice">
2041
<ref name="form-connection-resource"/>
2042
</define>
Database Table Name
The text:table-name attribute specifies a table within the source database.
2043
<define name="common-field-database-table-attlist" combine="interleave">
2044
<attribute name="text:table-name">
2045
<ref name="string"/>
2046
</attribute>
2047
</define>
Database Type
The text:table-type attribute determines whether the database table refers to an SQL table,
an OpenDocument query, or the result of a SQL command.
2048
<define name="common-field-database-table-attlist" combine="interleave">
2049
<optional>
2050
<attribute name="text:table-type">
2051
<choice>
2052
<value>table</value>
2053
<value>query</value>
2054
<value>command</value>
2055
</choice>
2056
</attribute>
2057
</optional>
2058
</define>
6.5.2 Displaying Database Content
The <text:database-display> element displays data from a database. When a new data
set is added to a document, all fields that display data from that database table update their
content.
The attributes that may be associated with the <text:database-display> element are:

text:database-name, text:table-name and text:table-type
These attributes specify the database and database table that this field uses.

text:database-column-name
See following section Column Name for information about this attribute.

style:data-style-name
If the column specifies a numeric, Boolean, date, or time value, the data is formatted
according to the appropriate data style. If no data style is specified, the data style assigned
to this column in is used. See section 6.7.7 for more information about using this attribute.
2059
<define name="paragraph-content" combine="choice">
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 123 of 706

2060
<element name="text:database-display">
2061
<ref name="text-database-display-attlist"/>
2062
<text/>
2063
</element>
2064
</define>
2065
<define name="text-database-display-attlist" combine="interleave">
2066
<ref name="common-field-database-table"/>
2067
</define>
2068
<define name="text-database-display-attlist" combine="interleave">
2069
<ref name="common-field-data-style-name-attlist"/>
2070
</define>
Column Name
The text:column-name attribute specifies the column from which to display the data. The
value of this attribute must be a column contained in the specified database.
2071
<define name="text-database-display-attlist" combine="interleave">
2072
<attribute name="text:column-name">
2073
<ref name="string"/>
2074
</attribute>
2075
</define>
6.5.3 Selecting the Next Database Row
The <text:database-next> element changes the row in the current selection which is used
for display in all following <text:database-display> fields. The next row from the current
selection is chosen if it satisfies a given condition. If the next row is wanted regardless of any
condition, the condition may be omitted or set to true.
The attributes that may be associated with the <text:database-next> are:

text:database-name, text:table-name and text:table-type
These attributes specify the database and the database table that this field uses.

text:condition
See following section Condition for information about this attribute.
2076
<define name="paragraph-content" combine="choice">
2077
<element name="text:database-next">
2078
<ref name="text-database-next-attlist"/>
2079
</element>
2080
</define>
2081
<define name="text-database-next-attlist" combine="interleave">
2082
<ref name="common-field-database-table"/>
2083
</define>
Condition
The text:condition attribute specifies the condition expression. The expression is evaluated
and if the result interpreted as a Boolean value is true, the next row is used as the new current
row. Database field values can be used in the expression by enclosing in square brackets the
database name, the table name, and the column name, separated by dots.
If the text:condition attribute is not present, it is assumes that the formula true, meaning
that the next row is selected unconditionally.
2084
<define name="text-database-next-attlist" combine="interleave">
2085
<optional>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 124 of 706

2086
<attribute name="text:condition">
2087
<ref name="formula"/>
2088
</attribute>
2089
</optional>
2090
</define>
Example:
text:formula='ooo-w:[address book file.address.FIRSTNAME] == "Julie"'
This example specifies a condition that is true if the current row from an address book database
table is the address for a person named Julie. If the condition shown in this example is used in a
<text:database-next> element, the following happens:

The <text:database-display> elements display the data from the first row of the
current selection.

If the FIRSTNAME column of the current row reads Julie, the current row is changed.
Otherwise, nothing happens.

If the first row is Julie, the following <text:database-display> elements display data
from the second row. Otherwise, they display data from the first row.
See section 6.7.6 for more information on the formula syntax of a text:condition attribute,
which is the same as that of the text:formula attribute.
6.5.4 Selecting a Row Number
The <text:database-row-select> element selects a specific row from the current
selection. As with the <text:database-row-next> element, a condition can be specified so
that the given row is only selected if the condition is true.
The attributes that may be associated with the <text:database-row-select> are:

text:database-name, text:table-name and text:table-type
These attributes determine the database and the database table that this field uses.

text:condition
This attribute specifies the condition expression. See section 6.5.3 for a full explanation of
how to use this attribute.

text:row-number
See the fol owing section Selecting the Row Number about this attribute.
2091
<define name="paragraph-content" combine="choice">
2092
<element name="text:database-row-select">
2093
<ref name="text-database-row-select-attlist"/>
2094
</element>
2095
</define>
2096
<define name="text-database-row-select-attlist" combine="interleave">
2097
<ref name="common-field-database-table"/>
2098
</define>
2099
<define name="text-database-row-select-attlist" combine="interleave">
2100
<optional>
2101
<attribute name="text:condition">
2102
<ref name="formula"/>
2103
</attribute>
2104
</optional>
2105
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 125 of 706

Selecting the Row Number
This attribute specifies the row number to select when a condition is true.
2106
<define name="text-database-row-select-attlist" combine="interleave">
2107
<optional>
2108
<attribute name="text:row-number">
2109
<ref name="nonNegativeInteger"/>
2110
</attribute>
2111
</optional>
2112
</define>
6.5.5 Displaying the Row Number
The <text:database-row-number> element displays the current row number for a given
table. Note that the element displays the actual row number from the database and not the row
number of the current selection that is used as an attribute value in the <text:database-row-
select> element.
The attributes that may be associated with the <text:database-row-number> are:

text:database-name, text:table-name and text:table-type
These attributes determine the database and the database table that this field uses.

style:num-format and style:num-letter-sync
These attributes determine how the number should be formatted. See section 6.7.8 for more
information on how to use this attribute.

text:value
This attribute specifies the current row number. The number changes when new data is
added to the current document.
2113
<define name="paragraph-content" combine="choice">
2114
<element name="text:database-row-number">
2115
<interleave>
2116
<ref name="common-field-database-table"/>
2117
<ref name="common-field-num-format-attlist"/>
2118
<optional>
2119
<attribute name="text:value">
2120
<ref name="nonNegativeInteger"/>
2121
</attribute>
2122
</optional>
2123
</interleave>
2124
<text/>
2125
</element>
2126
</define>
6.5.6 Display Current Database and Table
Office applications may keeps track of the last database and table that was used in the
document. In other words, the table that is used by the last field that was inserted into the
document. The <text:database-name> element displays the database and table name of the
most recently used table.
The attributes that may be associated with the <text:database-name> element are:

text:database-name, text:table-name and text:table-type
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 126 of 706

These attributes determine the database and the database table that this field uses.
2127
<define name="paragraph-content" combine="choice">
2128
<element name="text:database-name">
2129
<ref name="common-field-database-table"/>
2130
<text/>
2131
</element>
2132
</define>
6.6 More Fields
6.6.1 Page Variable Fields
Page variables allow an alternative page numbering scheme to be defined. There is only one
page variable, and it is set by any set page variable field in the document. The value of the page
variable is increased on each page, in the same way as regular page numbers.
Setting Page Variable Fields
To set a page variable field, use the <text:variable-page-set> element.
2133
<define name="paragraph-content" combine="choice">
2134
<element name="text:page-variable-set">
2135
<ref name="text-set-page-variable-attlist"/>
2136
<text/>
2137
</element>
2138
</define>
Turning Page Variables On or Off
At the beginning of a document, the page variable is inactive. The text:active attribute can
be used to disable a page variable after it was used in the document.
2139
<define name="text-set-page-variable-attlist" combine="interleave">
2140
<optional>
2141
<attribute name="text:active">
2142
<ref name="boolean"/>
2143
</attribute>
2144
</optional>
2145
</define>
Page Variable Adjustment
The text:page-adjust attribute determines the page adjustment. The value of the active
page variable is the current page number plus the closest page adjustment value that was
previously set.
2146
<define name="text-set-page-variable-attlist" combine="interleave">
2147
<optional>
2148
<attribute name="text:page-adjust">
2149
<ref name="integer"/>
2150
</attribute>
2151
</optional>
2152
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 127 of 706

Displaying Page Variable Fields
The <text:variable-page-get> element displays the value of the page variable. The field
can be formatted in the same way as regular page number fields.
2153
<define name="paragraph-content" combine="choice">
2154
<element name="text:page-variable-get">
2155
<ref name="text-get-page-variable-attlist"/>
2156
<text/>
2157
</element>
2158
</define>
The attributes that may be associated with the <text:get-page-variable> element are:

style:num-format and style:num-letter-sync
These attributes determine how the number should be formatted. See section 6.7.8 for more
information on how to use these attributes.
2159
<define name="text-get-page-variable-attlist" combine="interleave">
2160
<ref name="common-field-num-format-attlist"/>
2161
</define>
6.6.2 Placeholders
The OpenDocument format uses placeholder fields to indicate locations in a document where the
user must fill in some information. For example in a letter template, a section of the document
can be reserved for the address of the recipient. A placeholder field displays text informing the
user about the purpose of the placeholder and sometimes includes a description. Placeholder
fields can represent different text elements, such as text or tables.
This element contains some brief text which is displayed with the placeholder.
2162
<define name="paragraph-content" combine="choice">
2163
<element name="text:placeholder">
2164
<ref name="text-placeholder-attlist"/>
2165
<text/>
2166
</element>
2167
</define>
The attributes that may be associated with the <text:placeholder> element are:

Placeholder type

Placeholder description
Placeholder Type
There are five different types of placeholder, representing the five possible types of content: text,
tables, text boxes, images, or objects. The text:placeholder-type attribute represents the
content type. This attribute is mandatory and it indicates which type of text content the
placeholder represents. The value of the attribute can be text, text-box, image, table, or
object.
2168
<define name="text-placeholder-attlist" combine="interleave">
2169
<attribute name="text:placeholder-type">
2170
<choice>
2171
<value>text</value>
2172
<value>table</value>
2173
<value>text-box</value>
2174
<value>image</value>
2175
<value>object</value>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 128 of 706

2176
</choice>
2177
</attribute>
2178
</define>
Placeholder Description
In addition to the brief text stored in the element content, may be associated a
text:description attribute with the placeholder element. This attribute is optional. The
purpose of the attribute is to contain a more elaborate description of the purpose of the
placeholder than the description stored in the element content. See section 6.7.4 for information
on using the text:description attribute.
2179
<define name="text-placeholder-attlist" combine="interleave">
2180
<ref name="common-field-description-attlist"/>
2181
</define>
6.6.3 Conditional Text Fields
Text fields can be used to display one text or another, depending on a condition. Conditional text
fields are given a condition and two text strings. If the condition is true, one of the text strings is
displayed. If the condition is false, the other text string is displayed.
2182
<define name="paragraph-content" combine="choice">
2183
<element name="text:conditional-text">
2184
<ref name="text-conditional-text-attlist"/>
2185
<text/>
2186
</element>
2187
</define>
The attributes that may be associated with the <text:conditional-text> element are:

Condition

Text to display if the condition is true

Text to display if the condition is false

Current condition
The text:condition attribute contains a Boolean expression. Depending on the result, the
value of the text:display-if-true or text:display-if-false attribute is displayed.
2188
<define name="text-conditional-text-attlist" combine="interleave">
2189
<attribute name="text:condition">
2190
<ref name="formula"/>
2191
</attribute>
2192
</define>
Text to Display if the Condition is True
The text:string-value-if-true attribute contains the text string to display if the condition
is true.
2193
<define name="text-conditional-text-attlist" combine="interleave">
2194
<attribute name="text:string-value-if-true">
2195
<ref name="string"/>
2196
</attribute>
2197
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 129 of 706

Text to Display if the Condition is False
The text:string-value-if-false attribute contains the text string to display if the
condition is false.
2198
<define name="text-conditional-text-attlist" combine="interleave">
2199
<attribute name="text:string-value-if-false">
2200
<ref name="string"/>
2201
</attribute>
2202
</define>
Current Value and Condition
The text:current-value attribute contains the evaluation result of the condition given by the
expression in the text:condition attribute. Explicitly giving the result allows applications to
delay evaluating the result until necessary. This attribute is valuable for the following reasons:

If the expression is costly to evaluate, for example, the expression contains references to
several databases.

To allow transformations to correctly display the state of the document without having to
parse and evaluate the condition.
2203
<define name="text-conditional-text-attlist" combine="interleave">
2204
<optional>
2205
<attribute name="text:current-value">
2206
<ref name="boolean"/>
2207
</attribute>
2208
</optional>
2209
</define>
Note: The value of this attribute is overwritten with a new value as soon as the
application evaluates the expression. This attribute has no function other than to
ease transformation or initially display the document.
6.6.4 Hidden Text Field
The hidden text field is closely related to the conditional text field. It displays fixed text, except
when the condition is true when it does not display anything.
2210
<define name="paragraph-content" combine="choice">
2211
<element name="text:hidden-text">
2212
<ref name="text-hidden-text-attlist"/>
2213
<text/>
2214
</element>
2215
</define>
The attributes that may be associated with the <text:hidden-text> element are:

Condition

Text

Is hidden
Condition
The text:condition attribute contains a Boolean expression. If the expression evaluates to
true, the text is hidden.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 130 of 706

2216
<define name="text-hidden-text-attlist" combine="interleave">
2217
<attribute name="text:condition">
2218
<ref name="formula"/>
2219
</attribute>
2220
</define>
Text
The text:string-value attribute specifies the text to display if the condition is false.
2221
<define name="text-hidden-text-attlist" combine="interleave">
2222
<attribute name="text:string-value">
2223
<ref name="string"/>
2224
</attribute>
2225
</define>
Is Hidden
The text:is-hidden attribute specifies whether or not the field is currently visible. The
purpose of this attribute is similar to that of the text:current-value attribute in the
text:condition field. Recording the result allows transformations to correctly represent the
document without having to parse the condition expression or evaluate the condition when
loading the document.
2226
<define name="text-hidden-text-attlist" combine="interleave">
2227
<optional>
2228
<attribute name="text:is-hidden">
2229
<ref name="boolean"/>
2230
</attribute>
2231
</optional>
2232
</define>
Note: The value of this attribute is overwritten with a new value as soon as the
application evaluates the expression. This attribute has no function other than to
ease transformation or initially display the document.
6.6.5 Reference Fields
The OpenDocument format uses four types of reference field and each type is represented by its
own element. The reference field types are based on the type of element they refer to; notes,
bookmarks, references, and sequences. Every reference contains a reference format which
determines what information about the referenced target is displayed. For example, references
can display:

The page number of the referenced target

The chapter number of the referenced target

Wording indicating whether the referenced target is above or below the reference field
In addition, each reference field must identify its target which is usually done using a name
attribute. Bookmarks and references are identified by the name of the respective bookmark or
reference. Footnotes, endnotes, and sequences are are assigned names by the application used
to create the OpenDocument file format automatically.
2233
<define name="paragraph-content" combine="choice">
2234
<element>
2235
<choice>
2236
<name>text:reference-ref</name>
2237
<name>text:bookmark-ref</name>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 131 of 706

2238
</choice>
2239
<interleave>
2240
<ref name="text-common-ref-content"/>
2241
<ref name="text-ref-content"/>
2242
</interleave>
2243
</element>
2244
</define>
2245
<define name="paragraph-content" combine="choice">
2246
<element name="text:note-ref">
2247
<interleave>
2248
<ref name="text-common-ref-content"/>
2249
<ref name="text-note-ref-content"/>
2250
<ref name="text-ref-content"/>
2251
</interleave>
2252
</element>
2253
</define>
2254
<define name="paragraph-content" combine="choice">
2255
<element name="text:sequence-ref">
2256
<interleave>
2257
<ref name="text-common-ref-content"/>
2258
<ref name="text-sequence-ref-content"/>
2259
</interleave>
2260
</element>
2261
</define>
2262
<define name="text-common-ref-content" combine="interleave">
2263
<text/>
2264
</define>
The attributes that may be associated with the reference field elements are:

Reference name

Reference format
Reference Name
The text:ref-name attribute identifies the referenced element. Since bookmarks and
references have a name, this name is used by the respective reference fields. Footnotes,
endnotes, and sequences are are identified by a name that is usually generated automatically.
2265
<define name="text-common-ref-content" combine="interleave">
2266
<optional>
2267
<attribute name="text:ref-name">
2268
<ref name="string"/>
2269
</attribute>
2270
</optional>
2271
</define>
Note Class
For <text:note-ref> elements, the text:note-class attribute determines whether the
field references a foot- or an endnote.
2272
<define name="text-note-ref-content" combine="interleave">
2273
<ref name="text-note-class"/>
2274
</define>
Reference Format
The text:reference-format attribute determines what information about the reference is
displayed. If the reference format is not specified, the page format is used as the default.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 132 of 706

All types of reference fields support the following values for this attribute formats:

page, which displays the number of the page on which the referenced item appears.

chapter, which displays the number of the chapter in which the referenced item appears.

direction, which displays whether the referenced item is above or below the reference
field.

text, which displays the text of the referenced item.
References to sequence fields support the following three additional values:

category-and-value, which displays the name and value of the sequence.

caption, which displays the caption in which the sequence is used.

value, which displays the value of the sequence.
2275
<define name="text-ref-content" combine="interleave">
2276
<optional>
2277
<attribute name="text:reference-format">
2278
<choice>
2279
<value>page</value>
2280
<value>chapter</value>
2281
<value>direction</value>
2282
<value>text</value>
2283
</choice>
2284
</attribute>
2285
</optional>
2286
</define>
2287
<define name="text-sequence-ref-content" combine="interleave">
2288
<optional>
2289
<attribute name="text:reference-format">
2290
<choice>
2291
<value>page</value>
2292
<value>chapter</value>
2293
<value>direction</value>
2294
<value>text</value>
2295
<value>category-and-value</value>
2296
<value>caption</value>
2297
<value>value</value>
2298
</choice>
2299
</attribute>
2300
</optional>
2301
</define>
Example: Different reference formats and displays
The following table shows all possible reference formats and the resulting reference display that
can be used to refer to the table itself. The left column lists the value of the text:reference-
format attribute and the right column
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 133 of 706

Reference format
Reference display
page
134
chapter
3.7.27
text
Table 2: Examples of reference
formats
direction
above
category-and-value Table 1
caption
Examples of reference formats
value
1
6.6.6 Script Fields
A script field stores scripts or sections of scripts. The field can be used to store and edit scripts
that are attached to the document. The primary purpose of this field is to provide an equivalent
to the <script> element in [HTML4], so that the content of a <script> element in HTML can
be imported, edited, and exported using an office application software.
The source code for the script can be stored in one of the following ways:

The <text:script> element contains the source code.

The source code is stored in an external file. Use the xlink:href attribute to specify the
location of the source file.
The element should have either a xlink:href attribute or content, but not both.
2302
<define name="paragraph-content" combine="choice">
2303
<element name="text:script">
2304
<interleave>
2305
<choice>
2306
<group>
2307
<attribute name="xlink:href">
2308
<ref name="anyURI"/>
2309
</attribute>
2310
<optional>
2311
<attribute name="xlink:type" a:defaultValue="simple">
2312
<value>simple</value>
2313
</attribute>
2314
</optional>
2315
</group>
2316
<text/>
2317
</choice>
2318
<optional>
2319
<attribute name="script:language">
2320
<ref name="string"/>
2321
</attribute>
2322
</optional>
2323
</interleave>
2324
</element>
2325
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 134 of 706

Script URL
The xlink:href attribute specifies the location of the file that contains the script source code.
The script field should have either an URL attribute or content, but not both.
Script Language
The script:language attribute specifies the language in which the script source code is
written, for example, JavaScript.
6.6.7 Macro Fields
The macro field contains the name of a macro that is executed when the field is activated. The
field also contains a description that is displayed as the field content.
The only attribute that may be associated with the <text:execute-macro> element is:

Macro name
2326
<define name="paragraph-content" combine="choice">
2327
<element name="text:execute-macro">
2328
<optional>
2329
<attribute name="text:name">
2330
<ref name="string"/>
2331
</attribute>
2332
</optional>
2333
<optional>
2334
<ref name="office-event-listeners"/>
2335
</optional>
2336
<text/>
2337
</element>
2338
</define>
Macro Name
The text:name attribute specifies the macro to invoke when the field is activated.
6.6.8 Hidden Paragraph Fields
The hidden paragraph field has a similar function to the hidden text field. However, the hidden
paragraph field does not have any content. It hides the paragraph in which it is contained. This
allows a paragraph of formatted text to be hidden or displayed depending on whether a condition
is true or false.
Hidden paragraph fields are often used together with form letters. For example, if a condition
depends on a database field, a hidden paragraph field can be used to selectively include
paragraphs in the form letter depending on the database content. Multiple paragraph fields can
be contained one paragraph. The paragraph is displayed if the condition associated with at least
one hidden paragraph field is false. Alternatively, the conditions associated with several hidden
paragraph fields can be combined into a single condition for a single field using logical
operations on the conditions.
Note: Unlike most fields, this field does not display text, but it affects the entire
paragraph in which it is contained.
The attributes that may be associated with the <text:hidden-paragraph> element are:
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 135 of 706


Condition

Is hidden
2339
<define name="paragraph-content" combine="choice">
2340
<element name="text:hidden-paragraph">
2341
<ref name="text-hidden-paragraph-attlist"/>
2342
<text/>
2343
</element>
2344
</define>
Condition
The text:condition attribute contains a Boolean expression. If the condition is true, the
paragraph is hidden. If the condition is false, the paragraph is displayed.
2345
<define name="text-hidden-paragraph-attlist" combine="interleave">
2346
<attribute name="text:condition">
2347
<ref name="formula"/>
2348
</attribute>
2349
</define>
Is Hidden
The text:is-hidden attribute records whether the paragraph is currently visible or not. It has
the same purpose as the corresponding attribute of the hidden text field, namely to allow correct
display of the paragraph without having to evaluate the condition first. The value of this attribute
is overwritten with a new value as soon as the application evaluates the expression.
Note: This attribute has no function other than to ease transformation or initially
display the document.
2350
<define name="text-hidden-paragraph-attlist" combine="interleave">
2351
<optional>
2352
<attribute name="text:is-hidden">
2353
<ref name="boolean"/>
2354
</attribute>
2355
</optional>
2356
</define>
6.6.9 DDE Connection Fields
A DDE field allows information from a DDE connection to be displayed. The only parameter
required for the DDE field is the name of the DDE connection that supplies the data to this field.
This DDE connection element specifies the actual DDE field that appears in the text body.
The field element contains the content of the most recent data that was received from the DDE
connection. This may be used to render the document if the DDE connection cannot be
accessed.
2357
<define name="paragraph-content" combine="choice">
2358
<element name="text:dde-connection">
2359
<attribute name="text:connection-name">
2360
<ref name="string"/>
2361
</attribute>
2362
<text/>
2363
</element>
2364
</define>
The only attribute that may be associated with the <text:dde-connection> element is:
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 136 of 706


DDE connection name
DDE Connection Name
The text:name attribute specifies the name of the DDE connection to which the field refers.
6.6.10 Measure Fields
Within the text contained in measure drawing objects (see section 9.2.11), a <text:measure>
field displays the current measure. The draw:kind attribute specifies which part of the measure
is displayed. It my have one of the following values:

value: The measure's value is displayed, for instance “12”

unit: The measure's unit is displayed, for instance “inch”

gap: A gap or blank is displayed if and only if the measure text's writing direction is
perpendicular to the measure line. The purpose of this value is add some space between the
measure line and the text if the text is displayed perpendicular to the measure line.
2365
<define name="paragraph-content" combine="choice">
2366
<element name="text:measure">
2367
<attribute name="text:kind">
2368
<choice>
2369
<value>value</value>
2370
<value>unit</value>
2371
<value>gap</value>
2372
</choice>
2373
</attribute>
2374
<text/>
2375
</element>
2376
</define>
6.6.11 Table Formula Field
The table formula field is a legacy from previous versions of current office applications. It should
not be used in new documents. It stores a formula to be used in tables, a function that is better
performed by the table:formula attribute of the table cell.
Note: This element should not be used in new documents.
The table formula field can take the following attributes:

text:formula
This attribute contains the actual expression used to compute the value of the table formula
field. See section 6.7.6 for information on using this attribute.

text:display
Use this attribute to specify one of the following:

To display the value of the field.

To display the formula used to compute the value.
See section 6.7.5 for information on using this attribute.

style:data-style-name
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 137 of 706

This attribute specifies the data style to use to format a numeric, Boolean, or date/time
variable. If a data style is not specified, a standard data style is used. See section 6.7.7 for
information on using this attribute.
2377
<define name="paragraph-content" combine="choice">
2378
<element name="text:table-formula">
2379
<interleave>
2380
<ref name="common-field-formula-attlist"/>
2381
<ref name="common-field-display-value-formula-attlist"/>
2382
<ref name="common-field-data-style-name-attlist"/>
2383
</interleave>
2384
<text/>
2385
</element>
2386
</define>
6.7 Common Field Attributes
The attributes described in this section can be used with several field elements.
6.7.1 Variable Value Types and Values
Variables and most variable fields have a current value. Every variable has a value type that
must be specified when the field supports multiple value types. The value type is specified using
the office:value-type attribute.
2387
<define name="common-value-type-attlist">
2388
<attribute name="office:value-type">
2389
<ref name="valueType"/>
2390
</attribute>
2391
</define>
Depending on the value type, the value itself is written to different value attributes. The
supported value types, their respective value attributes, and how the values are encoded are
described in the following table:
Value Type
Value Attribute(s)
Encoded as...
Example
float
office:value
Numeric value
"12.345"
percentage office:value
Numeric value
"0.50"
currency
office:value and
Numeric value and
"100"
office:currency
currency symbol
"USD"
date
office:date-value
Date value as specified in §3.2.9 "2003-04-17"
of [xmlschema-2], or date and
time value as specified in §3.2.7
of [xmlschema-2]
time
office:time-value
Duration, as specified in §3.2.6
"PT03H30M00S
of [xmlschema-2]
"
boolean
office:boolean-value true or false
"true"
string
office:string-value
Strings
"abc def"
The OpenDocument concept of field values and value types and their encoding in XML is
modeled on the corresponding XML for table cell attributes. See section 8.1.3 for information on
table cells and their attributes.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 138 of 706

The definition of the entity %value-attlist; is as follows:
2392
<define name="common-value-and-type-attlist">
2393
<choice>
2394
<group>
2395
<attribute name="office:value-type">
2396
<value>float</value>
2397
</attribute>
2398
<attribute name="office:value">
2399
<ref name="double"/>
2400
</attribute>
2401
</group>
2402
<group>
2403
<attribute name="office:value-type">
2404
<value>percentage</value>
2405
</attribute>
2406
<attribute name="office:value">
2407
<ref name="double"/>
2408
</attribute>
2409
</group>
2410
<group>
2411
<attribute name="office:value-type">
2412
<value>currency</value>
2413
</attribute>
2414
<attribute name="office:value">
2415
<ref name="double"/>
2416
</attribute>
2417
<optional>
2418
<attribute name="office:currency">
2419
<ref name="string"/>
2420
</attribute>
2421
</optional>
2422
</group>
2423
<group>
2424
<attribute name="office:value-type">
2425
<value>date</value>
2426
</attribute>
2427
<attribute name="office:date-value">
2428
<ref name="dateOrDateTime"/>
2429
</attribute>
2430
</group>
2431
<group>
2432
<attribute name="office:value-type">
2433
<value>time</value>
2434
</attribute>
2435
<attribute name="office:time-value">
2436
<ref name="duration"/>
2437
</attribute>
2438
</group>
2439
<group>
2440
<attribute name="office:value-type">
2441
<value>boolean</value>
2442
</attribute>
2443
<attribute name="office:boolean-value">
2444
<ref name="boolean"/>
2445
</attribute>
2446
</group>
2447
<group>
2448
<attribute name="office:value-type">
2449
<value>string</value>
2450
</attribute>
2451
<optional>
2452
<attribute name="office:string-value">
2453
<ref name="string"/>
2454
</attribute>
2455
</optional>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 139 of 706

2456
</group>
2457
</choice>
2458
</define>
6.7.2 Fixed
The text:fixed attribute specifies whether or not the value of a field element is fixed. If the
value of a field is fixed, the value of the field element to which this attribute is attached is
preserved in all future edits of the document. If the value of the field is not fixed, the value of the
field may be replaced by a new value when the document is edited.
This attribute can be used with:

Date fields

Time fields

Page number fields

All sender fields

All author fields
2459
<define name="common-field-fixed-attlist">
2460
<optional>
2461
<attribute name="text:fixed">
2462
<ref name="boolean"/>
2463
</attribute>
2464
</optional>
2465
</define>
6.7.3 Variable Name
Use the text:name attribute to specify the name of a variable when it is being declared, set, or
displayed a variable. This attribute can be used with any of the following elements:

<text:variable-del>

<text:variable-set>

<text:variable-get>

<text:variable-input>

<text:user-field-del>

<text:user-field-get>

<text:user-field-input>

<text:sequence-del>

<text:sequence>
When this attribute is being used to specify the name of a variable to display, a variable of the
appropriate type with the same name must already have been declared.
2466
<define name="common-field-name-attlist">
2467
<attribute name="text:name">
2468
<ref name="variableName"/>
2469
</attribute>
2470
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 140 of 706

6.7.4 Description
The text:description attribute contains a brief message that is displayed when users are
prompted for input. This attribute can be used with any of the following elements:

<text:placeholder>

<text:variable-input>

<text:user-field-input>

<text:text-input>
2471
<define name="common-field-description-attlist">
2472
<optional>
2473
<attribute name="text:description">
2474
<text/>
2475
</attribute>
2476
</optional>
2477
</define>
6.7.5 Display
The text:display attribute supports up to three values as follows:

value
This value displays the value of the field. Some fields do not support this value. In these
cases, the text:display attribute only takes the values value or none, and value or
formula, respectively.

formula
This value allows the display of the formula rather than the value of the field. Some fields do
not support this value. In these cases, the text:display attribute only takes the values
value or none, and value or formula, respectively.

none
Several variable fields support this value, which hides the field content. This allows variables
to be set in one part of the document and displayed in another part of the document.
This attribute can be used with any of the following elements:

<text:variable-set>

<text:variable-get>

<text:variable-input>

<text:user-field-get>

<text:expression>
2478
<define name="common-field-display-value-none-attlist">
2479
<optional>
2480
<attribute name="text:display">
2481
<choice>
2482
<value>value</value>
2483
<value>none</value>
2484
</choice>
2485
</attribute>
2486
</optional>
2487
</define>
2488
<define name="common-field-display-value-formula-none-attlist">
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 141 of 706

2489
<optional>
2490
<attribute name="text:display">
2491
<choice>
2492
<value>value</value>
2493
<value>formula</value>
2494
<value>none</value>
2495
</choice>
2496
</attribute>
2497
</optional>
2498
</define>
2499
<define name="common-field-display-value-formula-attlist">
2500
<optional>
2501
<attribute name="text:display">
2502
<choice>
2503
<value>value</value>
2504
<value>formula</value>
2505
</choice>
2506
</attribute>
2507
</optional>
2508
</define>
6.7.6 Formula
The text:formula attribute contains the formula or expression used to compute the value of
the field. This attribute can be used with any of the following elements:

<text:variable-set>

<text:user-field-del>

<text:sequence>

<text:expression>
The formula should start with a namespace prefix hat indicates the syntax and semantic used
within the formula.
2509
<define name="common-field-formula-attlist">
2510
<optional>
2511
<attribute name="text:formula">
2512
<ref name="formula"/>
2513
</attribute>
2514
</optional>
2515
</define>
6.7.7 Formatting Style
The style:data-style-name attribute refers to the data style used to format the numeric
value. For general information about styles, see Chapter 14. For more information about data
styles, see section 14.7.
For string variables this attribute must be omitted. Otherwise, this attribute is required.
The name must match the name of a data style.
This attribute can be used with any of the following elements:

<text:date>

<text:time>

<text:page-number>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 142 of 706


<text:variable-set>

<text:variable-get>

<text:variable-input>

<text:user-field-get>

<text:user-field-input>

<text:expression>
2516
<define name="common-field-data-style-name-attlist">
2517
<optional>
2518
<attribute name="style:data-style-name">
2519
<ref name="styleNameRef"/>
2520
</attribute>
2521
</optional>
2522
</define>
6.7.8 Number Formatting Style
Numbers that are used for number sequences such as page numbers or sequence fields can be
formatted according to the number styles described in section 12.2. The number styles supported
are as follows:

Numeric: 1, 2, 3, ...

Alphabetic: a, b, c, ... or A, B, C, ...

Roman: i, ii, iii, iv, ... or I, II, III, IV,...
Note: The value of this attribute can be any of the [XSLT] number format keys 1,
i, I, a, or A.
Alphabetic number styles need an additional attribute to determine how to display numbers that
cannot be represented by a single letter. The OpenDocument format supports:

Synchronized letter numbering, where letters are used multiple times, for example aa, bb,
cc, and so on.

Non-synchronized letter numbering, for example aa, ab, ac, and so on.
See section 12.2 for more information.
2523
<define name="common-field-num-format-attlist">
2524
<optional>
2525
<ref name="common-num-format-attlist"/>
2526
</optional>
2527
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 143 of 706

7 Text Indices
OpenDocument text documents may contain automatically generated indices. An index generally
contains a sorted list of all items of a certain types, where the sorting (document position,
alphabetical, etc.) and the type of items (chapter headings, tables, etc.) are determined by the
specific type of index.
7.1 Index Marks
There are three types of index marks that correspond to the three types of index that make use
of index marks. The three types of index marks are:

Table of content index marks

User-defined index marks

Alphabetical index marks
The XML code for index marks is similar to the code for Bookmarks and References. The
following are some basic rules about index marks:

Each index mark is represented by a start and an end element.

Both elements use an ID attribute to match the appropriate start and end elements.

The start and end elements for an index mark must be contained in the same paragraph,
with the start element occurring first.

The attributes associated with the index mark are attached to the start element.

The text between the start and end elements is the text the index entry.

The formatting attributes for index marks can overlap.
7.1.1 Table of Content Index Marks
The <text:toc-mark-start> element marks the start of a table of content index entry. The
ID specified by the text:id attribute must be unique except for the matching index mark end
element. There must be an end element to match the start element located in the same
paragraph, with the start element appearing first.
2528
<define name="paragraph-content" combine="choice">
2529
<element name="text:toc-mark-start">
2530
<ref name="text-toc-mark-start-attrs"/>
2531
</element>
2532
</define>
The attributes associated with the <text:toc-mark-start> element are:

A text:id attribute to allow the start and end elements to be matched.

A text:outline-level attribute to specify the outline level of the resulting table of
content index entry.
2533
<define name="text-toc-mark-start-attrs">
2534
<ref name="text-id"/>
2535
<ref name="text-outline-level"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 144 of 706

2536
</define>
2537
<define name="text-outline-level">
2538
<optional>
2539
<attribute name="text:outline-level">
2540
<ref name="positiveInteger"/>
2541
</attribute>
2542
</optional>
2543
</define>
2544
<define name="text-id">
2545
<attribute name="text:id">
2546
<ref name="string"/>
2547
</attribute>
2548
</define>
The <text:toc-mark-end> element marks the end of a table of contents index entry. There
must be a start element with the same text:id value to match the end element located in the
same paragraph, with the start element appearing first.
2549
<define name="paragraph-content" combine="choice">
2550
<element name="text:toc-mark-end">
2551
<ref name="text-id"/>
2552
</element>
2553
</define>
Table of content index marks also have a variant that does not enclose the text to be indexed.
This is represented using the <text:toc-mark> element which contains a text:string-
value attribute for the text of the index entry. In this situation, a text:id attribute is not
necessary because there are no start and end elements to match.
2554
<define name="paragraph-content" combine="choice">
2555
<element name="text:toc-mark">
2556
<attribute name="text:string-value">
2557
<ref name="string"/>
2558
</attribute>
2559
<ref name="text-outline-level"/>
2560
</element>
2561
</define>
7.1.2 User-Defined Index Marks
The <text:user-index-mark-start> element marks the start of a user-defined index
entry. The ID specified by the text:id attribute must be unique except for the matching index
mark end element. There must be an end element to match the start element located in the
same paragraph, with the start element appearing first.
2562
<define name="paragraph-content" combine="choice">
2563
<element name="text:user-index-mark-start">
2564
<ref name="text-id"/>
2565
<ref name="text-outline-level"/>
2566
<ref name="text-index-name"/>
2567
</element>
2568
</define>
The <text:user-index-mark-end> element marks the end of the user-defined index entry.
There must be a start element with the same text:id value to match the end element located in
the same paragraph, with the start element appearing first.
2569
<define name="paragraph-content" combine="choice">
2570
<element name="text:user-index-mark-end">
2571
<ref name="text-id"/>
2572
<ref name="text-outline-level"/>
2573
</element>
2574
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 145 of 706

User index marks also have a variant that does not enclose the text to be indexed. This is
represented by the <text:user-index-mark> element which contains a text:string-
value attribute for the text of the index entry. In this situation, the text:id attribute is not
necessary because there are no start and end elements to match.
2575
<define name="paragraph-content" combine="choice">
2576
<element name="text:user-index-mark">
2577
<attribute name="text:string-value">
2578
<ref name="string"/>
2579
</attribute>
2580
<ref name="text-outline-level"/>
2581
<ref name="text-index-name"/>
2582
</element>
2583
</define>
Name of User Index
There can be more than one user-defined index. In this case, the user index must be named
using the text:index-name attribute. This attribute determines to which user-defined index an
index mark belongs. If no name is given, the default user-defined index is used.
2584
<define name="text-index-name">
2585
<attribute name="text:index-name">
2586
<ref name="string"/>
2587
</attribute>
2588
</define>
7.1.3 Alphabetical Index Mark
The <text:alpha-index-mark-start> element marks the start of an alphabetical index
entry. There are two optional attributes that may contain keys for alphabetical entries, which
allows structuring of entries. There is also a Boolean attribute that determines if this entry is
intended to be the main entry, if there are several equal entries.
The ID specified by the text:id attribute must be unique except for the matching index mark end
element. There must be an end element to match the start element located in the same
paragraph, with the start element appearing first.
2589
<define name="paragraph-content" combine="choice">
2590
<element name="text:alphabetical-index-mark-start">
2591
<ref name="text-id"/>
2592
<ref name="text-alphabetical-index-mark-attrs"/>
2593
</element>
2594
</define>
The attributes associated with the <text:toc-mark-start> element are:

A text:id attribute to allow the start and end elements to be matched.

Additional keys

Main entry
The <text:alpha-index-mark-end> element marks the end of an alphabetical index entry.
There must be a start element with the same text:id value to match the end element located in
the same paragraph, with the start element appearing first.
2595
<define name="paragraph-content" combine="choice">
2596
<element name="text:alphabetical-index-mark-end">
2597
<ref name="text-id"/>
2598
</element>
2599
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 146 of 706

Alphabetical index marks also have a variant that does not enclose the text to be indexed. This
is represented using the <text:alpha-index-mark> element which contains a
text:string-value attribute for the text of the index entry. In this situation, a text:id
attribute is not necessary because there are no start and end elements to match.
2600
<define name="paragraph-content" combine="choice">
2601
<element name="text:alphabetical-index-mark">
2602
<attribute name="text:string-value">
2603
<ref name="string"/>
2604
</attribute>
2605
<ref name="text-alphabetical-index-mark-attrs"/>
2606
</element>
2607
</define>
Additional Keys
The text:key1 and text:key2 attributes specify additional keys for the alphabetical index
mark. If only one key is used, it must be contained in the text:key1 attribute.
2608
<define name="text-alphabetical-index-mark-attrs" combine="interleave">
2609
<optional>
2610
<attribute name="text:key1">
2611
<ref name="string"/>
2612
</attribute>
2613
</optional>
2614
<optional>
2615
<attribute name="text:key2">
2616
<ref name="string"/>
2617
</attribute>
2618
</optional>
2619
</define>
Phonetic Keys
For ideographic languages, there sometimes is no obvious or common sorting of the language's
characters. One common scheme to facilitate an alphabetical index in such languages is to sort
according to a phonetic description of the search time. To achieve this in the OpenDocument file
format, there are additional attributes for the string value and the two keys for phonetic
descriptions. The original value and key attributes are for display, but if phonetic variants are
present, they should be used for sorting the index.
2620
<define name="text-alphabetical-index-mark-attrs" combine="interleave">
2621
<optional>
2622
<attribute name="text:string-value-phonetic">
2623
<ref name="string"/>
2624
</attribute>
2625
</optional>
2626
<optional>
2627
<attribute name="text:key1-phonetic">
2628
<ref name="string"/>
2629
</attribute>
2630
</optional>
2631
<optional>
2632
<attribute name="text:key2-phonetic">
2633
<ref name="string"/>
2634
</attribute>
2635
</optional>
2636
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 147 of 706

Main Entry
If there are several index marks for the same entry, one of these entries may be declared as the
main entry using the text:main-entry attribute.
2637
<define name="text-alphabetical-index-mark-attrs" combine="interleave">
2638
<optional>
2639
<attribute name="text:main-entry" a:defaultValue="false">
2640
<ref name="boolean"/>
2641
</attribute>
2642
</optional>
2643
</define>
7.1.4 Bibliography Index Mark
The <text:bibliography-mark> element contains the text and information for a
bibliography index entry. It supports attributes for each type of bibliographical data that a
bibliography index may contain.
2644
<define name="paragraph-content" combine="choice">
2645
<element name="text:bibliography-mark">
2646
<attribute name="text:bibliography-type">
2647
<ref name="text-bibliography-types"/>
2648
</attribute>
2649
<zeroOrMore>
2650
<attribute>
2651
<choice>
2652
<name>text:identifier</name>
2653
<name>text:address</name>
2654
<name>text:annote</name>
2655
<name>text:author</name>
2656
<name>text:booktitle</name>
2657
<name>text:chapter</name>
2658
<name>text:edition</name>
2659
<name>text:editor</name>
2660
<name>text:howpublished</name>
2661
<name>text:institution</name>
2662
<name>text:journal</name>
2663
<name>text:month</name>
2664
<name>text:note</name>
2665
<name>text:number</name>
2666
<name>text:organizations</name>
2667
<name>text:pages</name>
2668
<name>text:publisher</name>
2669
<name>text:school</name>
2670
<name>text:series</name>
2671
<name>text:title</name>
2672
<name>text:report-type</name>
2673
<name>text:volume</name>
2674
<name>text:year</name>
2675
<name>text:url</name>
2676
<name>text:custom1</name>
2677
<name>text:custom2</name>
2678
<name>text:custom3</name>
2679
<name>text:custom4</name>
2680
<name>text:custom5</name>
2681
<name>text:isbn</name>
2682
<name>text:issn</name>
2683
</choice>
2684
<ref name="string"/>
2685
</attribute>
2686
</zeroOrMore>
2687
<text/>
2688
</element>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 148 of 706

2689
</define>
2690
<define name="text-bibliography-types">
2691
<choice>
2692
<value>article</value>
2693
<value>book</value>
2694
<value>booklet</value>
2695
<value>conference</value>
2696
<value>custom1</value>
2697
<value>custom2</value>
2698
<value>custom3</value>
2699
<value>custom4</value>
2700
<value>custom5</value>
2701
<value>email</value>
2702
<value>inbook</value>
2703
<value>incollection</value>
2704
<value>inproceedings</value>
2705
<value>journal</value>
2706
<value>manual</value>
2707
<value>mastersthesis</value>
2708
<value>misc</value>
2709
<value>phdthesis</value>
2710
<value>proceedings</value>
2711
<value>techreport</value>
2712
<value>unpublished</value>
2713
<value>www</value>
2714
</choice>
2715
</define>
7.2 Index Structure
An index consists of two parts: The index source, and the index body. Both of these are
contained in an element of their own, which in turn form the two child elements for the index
element itself.
The index source is specific to the type of index it is being used for. It contains the information
necessary to generate the index content. An index source has no graphical rendition.
The index body is the same for all types of indices. It contains the text generated from the
information in the index source. The text contained in an index body is in no way special or
different from text used elsewhere in this specification.
The content of the index body can be regenerated at any time from the information contained in
the index source and the remainder of the document. One could say that the index source
contains all the logical information about an index, while the index body contains the rendition of
the index. A tool extracting structure information about a document might look only at the index
source, while a rendering program might look only at an index body.
7.2.1 Index Source
An index source element contains the information necessary to generate the index body. In
addition to a set of flags that determine which information to include in an index, the index
source contains a set of index templates. Such a template determines how an item to be
contained in the index is to be rendered.
For example, a table of content might look as follows:
1 Introduction.......................................................................................................7
1.1 Namespaces..................................................................................................7
1.2 Relax-NG Schema Prefix..............................................................................8
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 149 of 706

An index source for this index would contain flags indicating that chapter headers at least up to
level 2 are to be included. The contained index templates would define that an entry consists of
the chapter number, a space, the chapter name, a tab (with a '.' leader) and the page number.
The various index templates are described together with their index elements. The index
templates elements in use are described in section 7.12.
The different index source elements are described together with their corresponding index
elements.
7.2.2 Index Body Section
The index body contains the current textual rendition of the index. The format is the same as for
regular text within this specification, e.g. text sections, except that it also allows index title
sections.
2716
<define name="text-index-body">
2717
<element name="text:index-body">
2718
<zeroOrMore>
2719
<ref name="index-content-main"/>
2720
</zeroOrMore>
2721
</element>
2722
</define>
2723
<define name="index-content-main">
2724
<choice>
2725
<ref name="text-content"/>
2726
<ref name="text-index-title"/>
2727
</choice>
2728
</define>
7.2.3 Index Title Section
The index title is usually contained in a section of its own. The reason for this enclosure is to
enable the popular layout of having an index title across the entire page, but having the index
itself in a two column layout.
2729
<define name="text-index-title">
2730
<element name="text:index-title">
2731
<ref name="sectionAttr"/>
2732
<zeroOrMore>
2733
<ref name="index-content-main"/>
2734
</zeroOrMore>
2735
</element>
2736
</define>
7.3 Table Of Content
A table of contents provides the user with a guide through the content of the document. It is
typically found at the beginning of a document, contains the chapter headings with their
respective page numbers. An example for a table of content may be found at the beginning of
this document.
The items that can be listed in a table of content are:
• Headers (as defined by the outline structure of the document), up to a selectable level
• Table of content index marks
• Paragraphs formatted with a set of selectable paragraph styles
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 150 of 706

The table of contents is represented by the <text:table-of-content> element. The
<text:table-of-content> element supports the same style (and class) attributes as a text
section (see section 4.4).
2737
<define name="text-table-of-content">
2738
<element name="text:table-of-content">
2739
<ref name="sectionAttr"/>
2740
<ref name="text-table-of-content-source"/>
2741
<ref name="text-index-body"/>
2742
</element>
2743
</define>
7.3.1 Table of Content Source
The <text:table-of-content-source> element specifies how the table of contents is
generated. It specifies how the entries are gathered.
The <text:table-of-content-source> element contains

an optional template for the index title

optional templates for index entries, one per level

optionally a list of styles to be used for gathering index entries
2744
<define name="text-table-of-content-source">
2745
<element name="text:table-of-content-source">
2746
<ref name="text-table-of-content-source-attlist"/>
2747
<optional>
2748
<ref name="text-index-title-template"/>
2749
</optional>
2750
<zeroOrMore>
2751
<ref name="text-table-of-content-entry-template"/>
2752
</zeroOrMore>
2753
<zeroOrMore>
2754
<ref name="text-index-source-styles"/>
2755
</zeroOrMore>
2756
</element>
2757
</define>
The attributes that may be associated with the <text:table-of-content-source> element
are:

Outline level

Use outline

Use index marks

Use index source styles

Index source

Relative tab stop position
Outline Level
The text:outline-level attribute specifies which outline levels are used when generating
the table of contents.
The value of this attribute must be an integer greater than zero. If this attribute is omitted, all
outline levels are used by default.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 151 of 706

2758
<define name="text-table-of-content-source-attlist" combine="interleave">
2759
<optional>
2760
<attribute name="text:outline-level">
2761
<choice>
2762
<ref name="positiveInteger"/>
2763
</choice>
2764
</attribute>
2765
</optional>
2766
</define>
Use Outline
The text:use-outline-level attribute determines whether headings are used to generate
index entries. If the value is true, the table of contents includes entries generated from
headings. The text:outline-level attribute specifies up to which level headings are being
included. See section 7.1 for more information on index marks.
2767
<define name="text-table-of-content-source-attlist" combine="interleave">
2768
<optional>
2769
<attribute name="text:use-outline-level" a:defaultValue="true">
2770
<ref name="boolean"/>
2771
</attribute>
2772
</optional>
2773
</define>
Use Index Marks
The text:use-index-marks attribute determines whether or not index marks are used to
generate index entries. If the value is true, the table of contents includes entries generated
from table of content index marks. The text:outline-level attribute specifies up to which
level index marks are being included. See section 7.1 for more information on index marks.
2774
<define name="text-table-of-content-source-attlist" combine="interleave">
2775
<optional>
2776
<attribute name="text:use-index-marks">
2777
<ref name="boolean"/>
2778
</attribute>
2779
</optional>
2780
</define>
Use Index Source Styles
The text:use-index-source-styles attribute determines whether or not index entries are
generated for paragraph formatted using certain paragraph styles. If the value is true, the table
of contents includes an entry for every paragraph formatted with one of the styles specified in a
<text:index-source-style> element. The text:outline-level attribute specifies up to
which level index source styles are being included.
2781
<define name="text-table-of-content-source-attlist" combine="interleave">
2782
<optional>
2783
<attribute name="text:use-index-source-styles">
2784
<ref name="boolean"/>
2785
</attribute>
2786
</optional>
2787
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 152 of 706

Index Scope
The text:index-scope attribute determines whether the table-of-content is generated for the
whole document, or only for the current chapter.
2788
<define name="text-table-of-content-source-attlist" combine="interleave">
2789
<optional>
2790
<attribute name="text:index-scope">
2791
<choice>
2792
<value>document</value>
2793
<value>chapter</value>
2794
</choice>
2795
</attribute>
2796
</optional>
2797
</define>
Relative Tab-Stop Position
The text:relative-tab-stop-position attribute determines whether the position of tab
stops is relative to the left margin or to the left indent as determined by the paragraph style. This
is useful for copying the same entry configuration for all outline levels because with relative tab
stop positions the tabs do not need to be adjusted to the respective paragraph format.
2798
<define name="text-table-of-content-source-attlist" combine="interleave">
2799
<optional>
2800
<attribute name="text:relative-tab-stop-position">
2801
<ref name="boolean"/>
2802
</attribute>
2803
</optional>
2804
</define>
7.3.2 Table of Content Entry Template
The <text:table-of-content-entry-template> element determines the format of an
index entry for a particular outline level. For each table of content, there must not be more than
one element for any outline level. (See below.)
2805
<define name="text-table-of-content-entry-template">
2806
<element name="text:table-of-content-entry-template">
2807
<ref name="text-table-of-content-entry-template-attlist"/>
2808
<zeroOrMore>
2809
<ref name="text-table-of-content-children"/>
2810
2811
</zeroOrMore>
2812
</element>
2813
</define>
A table of content entry template supports the following kinds of text elements:

Chapter and Page Number

Reference Text

Text Span

Tab

Hyperlink start and end
2814
<define name="text-table-of-content-children">
2815
<choice>
2816
<ref name="text-index-entry-chapter"/>
2817
<ref name="text-index-entry-page-number"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 153 of 706

2818
<ref name="text-index-entry-text"/>
2819
<ref name="text-index-entry-span"/>
2820
<ref name="text-index-entry-tab-stop"/>
2821
<ref name="text-index-entry-link-start"/>
2822
<ref name="text-index-entry-link-end"/>
2823
</choice>
2824
</define>
The attributes that may be associated associate with the <text:table-of-content-entry-
template> element are:
● Template outline level
● Paragraph style
Template Outline Level
This attribute specifies to which outline level the entry configuration applies. Outline levels must
be unique for the template elements in one index source.
2825
<define name="text-table-of-content-entry-template-attlist"
2826
combine="interleave">
2827
<attribute name="text:outline-level">
2828
<ref name="positiveInteger"/>
2829
</attribute>
2830
</define>
Paragraph Style
The text:style-name attribute specifies the paragraph style to use for this template.
2831
<define name="text-table-of-content-entry-template-attlist"
2832
combine="interleave">
2833
<attribute name="text:style-name">
2834
<ref name="styleNameRef"/>
2835
</attribute>
2836
</define>
7.4 Index of Illustrations
The index of illustrations lists all images and graphics in the current document or chapter. The
index entries can be derived from the caption of the illustration or the name of the illustration.
The attribute that may be attached to the <text:illustration-index> element is:
• text:style-name
This attribute specifies the section style to use for the index of illustrations.
2837
<define name="text-illustration-index">
2838
<element name="text:illustration-index">
2839
<ref name="sectionAttr"/>
2840
<ref name="text-illustration-index-source"/>
2841
<ref name="text-index-body"/>
2842
</element>
2843
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 154 of 706

7.4.1 Index of Illustration Source
The <text:illustration-index-source> element specifies how the index of illustrations
is generated.
2844
<define name="text-illustration-index-source">
2845
<element name="text:illustration-index-source">
2846
<ref name="text-illustration-index-source-attrs"/>
2847
<optional>
2848
<ref name="text-index-title-template"/>
2849
</optional>
2850
<optional>
2851
<ref name="text-illustration-index-entry-template"/>
2852
</optional>
2853
</element>
2854
</define>
The attributes that may be associated with a <text:illustration-index-source> element
are:
• Use caption
• Caption sequence name
• Caption sequence format
• Index scope
This attribute specifies whether the index applies to the entire document or only the the
current chapter.
• text:relative-tab-stop-position
This attribute specifies whether the position of tab stops are interpreted relative to the left
margin or the left indent.
2855
<define name="text-illustration-index-source-attrs" combine="interleave">
2856
<ref name="text-index-scope-attr"/>
2857
</define>
2858
<define name="text-index-scope-attr">
2859
<optional>
2860
<attribute name="text:index-scope" a:defaultValue="document">
2861
<choice>
2862
<value>document</value>
2863
<value>chapter</value>
2864
</choice>
2865
</attribute>
2866
</optional>
2867
</define>
2868
<define name="text-illustration-index-source-attrs" combine="interleave">
2869
<ref name="text-relative-tab-stop-position-attr"/>
2870
</define>
2871
<define name="text-relative-tab-stop-position-attr">
2872
<optional>
2873
<attribute name="text:relative-tab-stop-position"
2874
a:defaultValue="true">
2875
<ref name="boolean"/>
2876
</attribute>
2877
</optional>
2878
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 155 of 706

Use Caption
Each object contained in a text document has a name. In addition, images also have a caption.
The image caption or the image name can be gathered for the index of illustrations.
2879
<define name="text-illustration-index-source-attrs" combine="interleave">
2880
<optional>
2881
<attribute name="text:use-caption" a:defaultValue="true">
2882
<ref name="boolean"/>
2883
</attribute>
2884
</optional>
2885
</define>
Caption Sequence Name
Captions are associated with a sequence name. If the text:use-caption attribute is set to
true, this attribute must be used to specify the sequence with which the captions are
associated.
If this attribute is omitted, the default sequence for the object type is used, for example the
sequence “Illustration” is used for illustrations.
2886
<define name="text-illustration-index-source-attrs" combine="interleave">
2887
<optional>
2888
<attribute name="text:caption-sequence-name">
2889
<ref name="string"/>
2890
</attribute>
2891
</optional>
2892
</define>
Caption Sequence Format
If the entries for the index of illustrations are obtained from the image captions, this attribute
must be used to specify the format for the entries.
2893
<define name="text-illustration-index-source-attrs" combine="interleave">
2894
<optional>
2895
<attribute name="text:caption-sequence-format">
2896
<choice>
2897
<value>text</value>
2898
<value>category-and-value</value>
2899
<value>caption</value>
2900
</choice>
2901
</attribute>
2902
</optional>
2903
</define>
7.4.2 Illustration Index Entry Template
The illustration index entry template element determines the format of an index entry for a
particular outline level.
2904
<define name="text-illustration-index-entry-template">
2905
<element name="text:illustration-index-entry-template">
2906
<ref name="text-illustration-index-entry-content"/>
2907
</element>
2908
</define>
2909
<define name="text-illustration-index-entry-content">
2910
<ref name="text-illustration-index-entry-template-attrs"/>
2911
<zeroOrMore>
2912
<choice>
2913
<ref name="text-index-entry-page-number"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 156 of 706

2914
<ref name="text-index-entry-text"/>
2915
<ref name="text-index-entry-span"/>
2916
<ref name="text-index-entry-tab-stop"/>
2917
</choice>
2918
</zeroOrMore>
2919
</define>
The attribute that may be associated with the <text:illustration-index-entry-
template> element is:
• Paragraph style
Paragraph Style
This attribute identifies the paragraph style to use for this template.
2920
<define name="text-illustration-index-entry-template-attrs">
2921
<attribute name="text:style-name">
2922
<ref name="styleNameRef"/>
2923
</attribute>
2924
</define>
7.5 Index of Tables
The index of tables lists all of the tables in the current document or chapter. It works in exactly
the same way as the index of il ustrations.
2925
<define name="text-table-index">
2926
<element name="text:table-index">
2927
<ref name="sectionAttr"/>
2928
<ref name="text-table-index-source"/>
2929
<ref name="text-index-body"/>
2930
</element>
2931
</define>
7.5.1 Table Index Source
The <text:table-index-source> element specifies how the index of tables is generated.
The attributes that may be associated with this element are the same as those that can be
associated with the <text:illustration-index-source> element. See section 7.4.1 for
detailed information about these attributes.
2932
<define name="text-table-index-source">
2933
<element name="text:table-index-source">
2934
<ref name="text-illustration-index-source-attrs"/>
2935
<optional>
2936
<ref name="text-index-title-template"/>
2937
</optional>
2938
<optional>
2939
<ref name="text-table-index-entry-template"/>
2940
</optional>
2941
</element>
2942
</define>
7.5.2 Table Index Entry Template
The table index entry template element determines the format of an index entry for a particular
outline level.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 157 of 706

The attributes that may be associated with this element are the same as those that can be
associated with the <text:illustration-index-entry-template> element. See section
7.4.2 for detailed information about these attributes.
2943
<define name="text-table-index-entry-template">
2944
<element name="text:table-index-entry-template">
2945
<ref name="text-illustration-index-entry-content"/>
2946
</element>
2947
</define>
7.6 Index of Objects
The index of objects lists all of the objects in the current document or chapter. It gathers its
entries from the known object types.
2948
<define name="text-object-index">
2949
<element name="text:object-index">
2950
<ref name="sectionAttr"/>
2951
<ref name="text-object-index-source"/>
2952
<ref name="text-index-body"/>
2953
</element>
2954
</define>
7.6.1 Object Index Source
The <text:object-index-source> element determines which object types to include in the
index of objects. It also supports the standard index source attributes.
2955
<define name="text-object-index-source">
2956
<element name="text:object-index-source">
2957
<ref name="text-object-index-source-attrs"/>
2958
<optional>
2959
<ref name="text-index-title-template"/>
2960
</optional>
2961
<optional>
2962
<ref name="text-object-index-entry-template"/>
2963
</optional>
2964
</element>
2965
</define>
The attributes that may be associated with the <text:object-index-source> element are:

Use attributes, text:use-*-objects

Index scope (see section 7.4.1)
This attribute specifies whether the index applies to the entire document or only the the
current chapter.

Relative tab stop position (see section 7.4.1)
This attribute specifies whether the position of tab stops are interpreted relative to the left
margin or the left indent.
2966
<define name="text-object-index-source-attrs" combine="interleave">
2967
<ref name="text-index-scope-attr"/>
2968
</define>
2969
<define name="text-object-index-source-attrs" combine="interleave">
2970
<ref name="text-relative-tab-stop-position-attr"/>
2971
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 158 of 706

Use Attributes
The text:use-*-objects attributes specify which types of objects to include in the index of
objects. There is an attribute for each type of object as fol ows:

text:use-spreadsheet-objects

text:use-draw-objects

text:use-chart-objects

text:use-math-objects
Other objects are included or omitted using the following attribute:

text:use-other-objects
2972
<define name="text-object-index-source-attrs" combine="interleave">
2973
<optional>
2974
<attribute name="text:use-spreadsheet-objects" a:defaultValue="false">
2975
<ref name="boolean"/>
2976
</attribute>
2977
</optional>
2978
</define>
2979
<define name="text-object-index-source-attrs" combine="interleave">
2980
<optional>
2981
<attribute name="text:use-math-objects" a:defaultValue="false">
2982
<ref name="boolean"/>
2983
</attribute>
2984
</optional>
2985
</define>
2986
<define name="text-object-index-source-attrs" combine="interleave">
2987
<optional>
2988
<attribute name="text:use-draw-objects" a:defaultValue="false">
2989
<ref name="boolean"/>
2990
</attribute>
2991
</optional>
2992
</define>
2993
<define name="text-object-index-source-attrs" combine="interleave">
2994
<optional>
2995
<attribute name="text:use-chart-objects" a:defaultValue="false">
2996
<ref name="boolean"/>
2997
</attribute>
2998
</optional>
2999
</define>
3000
<define name="text-object-index-source-attrs" combine="interleave">
3001
<optional>
3002
<attribute name="text:use-other-objects" a:defaultValue="false">
3003
<ref name="boolean"/>
3004
</attribute>
3005
</optional>
3006
</define>
7.6.2 Object Index Entry Template
The object index entry template element determines the format of an index entry for a particular
outline level.
3007
<define name="text-object-index-entry-template">
3008
<element name="text:object-index-entry-template">
3009
<ref name="text-illustration-index-entry-content"/>
3010
</element>
3011
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 159 of 706

The attributes that may be associated with this element are the same as those that can be
associated with the <text:illustration-index-entry-template> element. See section
7.4.2 for detailed information about these attributes.
7.7 User-Defined Index
A user-defined index combines the capabilities of the indexes discussed earlier in this chapter. A
user-defined index can gather entries from the following sources:

Index marks

Paragraphs formatted using particular paragraph styles

Tables, images, or objects

Text frames
The <text:user-index> element represents a user-defined index.
3012
<define name="text-user-index">
3013
<element name="text:user-index">
3014
<ref name="sectionAttr"/>
3015
<ref name="text-user-index-source"/>
3016
<ref name="text-index-body"/>
3017
</element>
3018
</define>
7.7.1 User-Defined Index Source
The <text:user-index-source> element can contain several attributes that determine how
the index entries are gathered. It also supports an attribute that determines how the outline levels
of the index entries are gathered.
The paragraph formats that are used as index marks are encoded in <text:index-source-
styles> elements, just like in <text:table-of-content-source> elements.
3019
<define name="text-user-index-source">
3020
<element name="text:user-index-source">
3021
<ref name="text-user-index-source-attr"/>
3022
<optional>
3023
<ref name="text-index-title-template"/>
3024
</optional>
3025
<zeroOrMore>
3026
<ref name="text-user-index-entry-template"/>
3027
</zeroOrMore>
3028
<zeroOrMore>
3029
<ref name="text-index-source-styles"/>
3030
</zeroOrMore>
3031
</element>
3032
</define>
The attributes that may be associated with <text:user-index-source> elements are:

Use attributes, text:use-*

Copy outline level

Index scope (see section 7.4.1)
This attribute specifies whether the index applies to the entire document or only to the
current chapter.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 160 of 706


Index name
In order to support several user-defined indexes with different contents, user index marks
have a text:index-name attribute. The same attribute can be used with a <text:user-
index-source> element to specify which index marks apply to the current index.

Relative tab stop position (see section 7.4.1)
This attribute specifies whether the position of tab stops are interpreted relative to the left
margin or the left indent.
3033
<define name="text-user-index-source-attr" combine="interleave">
3034
<ref name="text-index-scope-attr"/>
3035
<ref name="text-relative-tab-stop-position-attr"/>
3036
<attribute name="text:index-name">
3037
<ref name="string"/>
3038
</attribute>
3039
</define>
Use Attributes
The text:use-* attributes specify which entries to include in the user-defined index. The
following attributes exist:

text:use-index-marks

text:use-graphics

text:use-tables

text:use-floating-frames

text:use-objects
3040
<define name="text-user-index-source-attr" combine="interleave">
3041
<optional>
3042
<attribute name="text:use-index-marks" a:defaultValue="false">
3043
<ref name="boolean"/>
3044
</attribute>
3045
</optional>
3046
<optional>
3047
<attribute name="text:use-graphics" a:defaultValue="false">
3048
<ref name="boolean"/>
3049
</attribute>
3050
</optional>
3051
<optional>
3052
<attribute name="text:use-tables" a:defaultValue="false">
3053
<ref name="boolean"/>
3054
</attribute>
3055
</optional>
3056
<optional>
3057
<attribute name="text:use-floating-frames"
3058
a:defaultValue="false">
3059
<ref name="boolean"/>
3060
</attribute>
3061
</optional>
3062
<optional>
3063
<attribute name="text:use-objects" a:defaultValue="false">
3064
<ref name="boolean"/>
3065
</attribute>
3066
</optional>
3067
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 161 of 706

Copy Outline Levels
This attribute can have a value of true or false.
If the value is true, the entries are gathered at the outline level of the source element to which
they refer.
If the value is false, all index entries gathered are at the top outline level. For example, if an
image appears in section 1.2.3, the entry for the image is located at outline level 3.
3068
<define name="text-user-index-source-attr" combine="interleave">
3069
<optional>
3070
<attribute name="text:copy-outline-levels"
3071
a:defaultValue="false">
3072
<ref name="boolean"/>
3073
</attribute>
3074
</optional>
3075
</define>
7.7.2 User-Defined Index Entry Template
User index entry templates support entry elements for chapter number, page number, entry text,
text spans, and tab stops.
3076
<define name="text-user-index-entry-template">
3077
<element name="text:user-index-entry-template">
3078
<ref name="text-user-index-entry-template-attrs"/>
3079
<zeroOrMore>
3080
<choice>
3081
<ref name="text-index-entry-chapter"/>
3082
<ref name="text-index-entry-page-number"/>
3083
<ref name="text-index-entry-text"/>
3084
<ref name="text-index-entry-span"/>
3085
<ref name="text-index-entry-tab-stop"/>
3086
</choice>
3087
</zeroOrMore>
3088
</element>
3089
</define>
The attributes that may be associated with the <text:user-index-entry-template>
elements are:

Template outline level

Paragraph style
Template Outline Level
The text:outline-level attribute specifies to which outline level this entry configuration
applies.
All <text:outline-level> elements that are contained in the same parent element must
specify different outline levels.
3090
<define name="text-user-index-entry-template-attrs" combine="interleave">
3091
<attribute name="text:outline-level">
3092
<ref name="positiveInteger"/>
3093
</attribute>
3094
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 162 of 706

Paragraph Style
The text:style-name attribute specifies the paragraph style to use for the template.
3095
<define name="text-user-index-entry-template-attrs" combine="interleave">
3096
<attribute name="text:style-name">
3097
<ref name="styleNameRef"/>
3098
</attribute>
3099
</define>
7.8 Alphabetical Index
An alphabetical index gathers its entries solely from index marks.
3100
<define name="text-alphabetical-index">
3101
<element name="text:alphabetical-index">
3102
<ref name="sectionAttr"/>
3103
<ref name="text-alphabetical-index-source"/>
3104
<ref name="text-index-body"/>
3105
</element>
3106
</define>
7.8.1 Alphabetical Index Source
The <text:alphabetical-index-source> element specifies how the alphabetical index is
generated.
3107
<define name="text-alphabetical-index-source">
3108
<element name="text:alphabetical-index-source">
3109
<ref name="text-alphabetical-index-source-attrs"/>
3110
<optional>
3111
<ref name="text-index-title-template"/>
3112
</optional>
3113
<zeroOrMore>
3114
<ref name="text-alphabetical-index-entry-template"/>
3115
</zeroOrMore>
3116
</element>
3117
</define>
The attributes that may be associated with <text:alphabetical-index-source> elements
are:

Ignore case

Main entry style name

Alphabetical separators

Combine entries attributes

Use keys as entries

Capitalize entries

Comma separated entries

Sort language, country and algorithm

Index scope (see section 7.4.1)
This attribute specifies whether the index applies to the entire document or only to the
current chapter.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 163 of 706


Relative tab stop position (see section 7.4.1)
This attribute specifies whether the position of tab stops are interpreted relative to the left
margin or the left indent.
3118
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3119
<ref name="text-index-scope-attr"/>
3120
<ref name="text-relative-tab-stop-position-attr"/>
3121
</define>
Ignore Case
The text:ignore-case attribute determines whether or not the capitalization of words is
ignored. If the value is true, the capitalization is ignored and entries that are identical except for
character case are listed as the same entries. If the value is false, the capitalization of words is
not ignored.
3122
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3123
<optional>
3124
<attribute name="text:ignore-case" a:defaultValue="false">
3125
<ref name="boolean"/>
3126
</attribute>
3127
</optional>
3128
</define>
Main Entry Style Name
The text:main-entry-style-name attribute determines the character style to use for main
entries. Subentries are formatted using the default character style determined by the paragraph
style of the entries.
3129
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3130
<optional>
3131
<attribute name="text:main-entry-style-name">
3132
<ref name="styleNameRef"/>
3133
</attribute>
3134
</optional>
3135
</define>
Alphabetical Separators
The text:alphabetical-separators attribute determines whether or not entries beginning
with the same letter are grouped and separated from the entries beginning with the next letter,
and so on.
The value of this attribute can be true or false.
If the value is true, all entries beginning with the same letter are grouped together. The index
contains headings for each section, for example, A for all entries starting with the letter A, B for
all entries starting with the letter B, and so on.
3136
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3137
<optional>
3138
<attribute name="text:alphabetical-separators" a:defaultValue="false">
3139
<ref name="boolean"/>
3140
</attribute>
3141
</optional>
3142
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 164 of 706

Combining Entries
There are several options for dealing with the common situation where there are multiple index
entries for the same word or phrase, as follows:

Multiple entries for the same word can be combined into a single entry using the
text:combine-entries attribute.

The pages referenced by a combined entry can be formatted as:

As a range of numbers separated by a dash using the text:combine-entries-
with-dash attribute

As the start number with a pp label, or the appropriate label for the chosen language,
using the text:combine-entries-with-pp attribute
3143
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3144
<optional>
3145
<attribute name="text:combine-entries" a:defaultValue="true">
3146
<ref name="boolean"/>
3147
</attribute>
3148
</optional>
3149
<optional>
3150
<attribute name="text:combine-entries-with-dash"
3151
a:defaultValue="false">
3152
<ref name="boolean"/>
3153
</attribute>
3154
</optional>
3155
<optional>
3156
<attribute name="text:combine-entries-with-pp" a:defaultValue="true">
3157
<ref name="boolean"/>
3158
</attribute>
3159
</optional>
3160
</define>
Example: Combining index entries
An index mark for the word “XML” occurs on pages 45, 46, 47, and 48. The entries can be
formatted as follows:
Entry formatted as
Result
Separate entries
XML 45
XML 46
etc.
Simple combined entries
XML 45, 46, 47, 48
Entries combined with dash XML 45-48
Entries combined with pp
XML 45pp
Use Keys as Entries
In addition to a keyword, index marks can have up to two keys. If the value of this attribute is
true, the keys are used as additional entries. If the value of this attribute is false, the keys are
used as subentries.
3161
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3162
<optional>
3163
<attribute name="text:use-keys-as-entries" a:defaultValue="false">
3164
<ref name="boolean"/>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 165 of 706

3165
</attribute>
3166
</optional>
3167
</define>
Capitalize Entries
The text:capitalize-entries attribute determines whether or not the entries in the index
are to be capitalized.
3168
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3169
<optional>
3170
<attribute name="text:capitalize-entries" a:defaultValue="false">
3171
<ref name="boolean"/>
3172
</attribute>
3173
</optional>
3174
</define>
Comma Separated Entries
The text:comma-separated attribute specifies how to treat multiple index entries. Instead of
listing each index entry on a separate line, multiple entries can be listed on a single line
separated by a comma. If the value of this attribute is true, multiple entries are listed on a
single line separated by a comma. By default, the value of this attribute is false and each index
entry is displayed on a separate line.
3175
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3176
<optional>
3177
<attribute name="text:comma-separated" a:defaultValue="false">
3178
<ref name="boolean"/>
3179
</attribute>
3180
</optional>
3181
</define>
Sort country, Language, and Algorithm
If index entries are to be sorted, these attributes can be used to specify the sorting. The
attributes country and language specify the sorting locale. For some locales, there are multiple
sorting algorithms in use. In this case, the algorithm attribute can be used to specify an algorithm
by name.
3182
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3183
<optional>
3184
<attribute name="fo:language">
3185
<ref name="languageCode"/>
3186
</attribute>
3187
</optional>
3188
</define>
3189
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3190
<optional>
3191
<attribute name="fo:country">
3192
<ref name="countryCode"/>
3193
</attribute>
3194
</optional>
3195
</define>
3196
<define name="text-alphabetical-index-source-attrs" combine="interleave">
3197
<optional>
3198
<attribute name="text:sort-algorithm">
3199
<ref name="string"/>
3200
</attribute>
3201
</optional>
3202
</define>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 166 of 706

7.8.2 Auto Mark File
The alphabetical index supports a so-called auto mark file. Such a file contains a list of terms,
and each occurrence of such a term is to be included in the alphabetical index. The alphabetical
index mark file is declared as part of the text declarations (see section 4.7). The declaration
element in an XLink, which points to the resource containing the list of terms.
3203
<define name="text-alphabetical-index-auto-mark-file">
3204
<element name="text:alphabetical-index-auto-mark-file">
3205
<attribute name="xlink:href">
3206
<ref name="anyURI"/>
3207
</attribute>
3208
<optional>
3209
<attribute name="xlink:type" a:defaultValue="simple">
3210
<value>simple</value>
3211
</attribute>
3212
</optional>
3213
</element>
3214
</define>
7.8.3 Alphabetical Index Entry Template
Alphabetical indexes support three levels; one level for the main index entry, and up to two
additional levels for keys associated with the index entries. Alphabetical indexes also use an
entry template for the alphabetical separator.
3215
<define name="text-alphabetical-index-entry-template">
3216
<element name="text:alphabetical-index-entry-template">
3217
<ref name="text-alphabetical-index-entry-template-attrs"/>
3218
<zeroOrMore>
3219
<choice>
3220
<ref name="text-index-entry-chapter"/>
3221
<ref name="text-index-entry-page-number"/>
3222
<ref name="text-index-entry-text"/>
3223
<ref name="text-index-entry-span"/>
3224
<ref name="text-index-entry-tab-stop"/>
3225
</choice>
3226
</zeroOrMore>
3227
</element>
3228
</define>
The attributes that may be associated with the <text:alphabetical-index-entry-
template> elements are:

Template outline level

Paragraph style
Template Outline Level
This attribute specifies whether the template applies to:

One of the three levels 1,2,or 3
or

The alphabetical separator
3229
<define name="text-alphabetical-index-entry-template-attrs"
3230
combine="interleave">
3231
<attribute name="text:outline-level">
3232
<choice>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 167 of 706

3233
<value>1</value>
3234
<value>2</value>
3235
<value>3</value>
3236
<value>separator</value>
3237
</choice>
3238
</attribute>
3239
</define>
Paragraph Style
The text:style-name attribute specifies the paragraph style to use for the template.
3240
<define name="text-alphabetical-index-entry-template-attrs"
3241
combine="interleave">
3242
<attribute name="text:style-name">
3243
<ref name="styleNameRef"/>
3244
</attribute>
3245
</define>
7.9 Bibliography
A bibliography index gathers its entries from bibliography index marks. The
<text:bibliography> element represents a bibliography.
3246
<define name="text-bibliography">
3247
<element name="text:bibliography">
3248
<ref name="sectionAttr"/>
3249
<ref name="text-bibliography-source"/>
3250
<ref name="text-index-body"/>
3251
</element>
3252
</define>
7.9.1 Bibliography Index Source
The <text:bibliography-source> element specifies how the bibliography is generated.
3253
<define name="text-bibliography-source">
3254
<element name="text:bibliography-source">
3255
<optional>
3256
<ref name="text-index-title-template"/>
3257
</optional>
3258
<zeroOrMore>
3259
<ref name="text-bibliography-entry-template"/>
3260
</zeroOrMore>
3261
</element>
3262
</define>
7.9.2 Bibliography Entry Template
Bibliography entry templates support entry elements for bibliography data, text spans, and tab
stops. There is one entry template element for each type of entry.
3263
<define name="text-bibliography-entry-template">
3264
<element name="text:bibliography-entry-template">
3265
<ref name="text-bibliography-entry-template-attrs"/>
3266
<zeroOrMore>
3267
<choice>
3268
<ref name="text-index-entry-span"/>
3269
<ref name="text-index-entry-tab-stop"/>
3270
<ref name="text-index-entry-bibliography"/>
3271
</choice>
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 168 of 706

3272
</zeroOrMore>
3273
</element>
3274
</define>
The attributes that may be associated with the <text:bibliography-entry-template>
elements are:

Bibliography type

Paragraph style
Bibliography Type
This attribute specifies to which type of bibliographical entry the template applies. This attribute
must be unique among all <text:bibliography-type> elements within the same parent
element.
3275
<define name="text-bibliography-entry-template-attrs" combine="interleave">
3276
<attribute name="text:bibliography-type">
3277
<ref name="text-bibliography-types"/>
3278
</attribute>
3279
</define>
Paragraph Style
The text:style-name attribute specifies the paragraph style to use for this template.
3280
<define name="text-bibliography-entry-template-attrs" combine="interleave">
3281
<attribute name="text:style-name">
3282
<ref name="styleNameRef"/>
3283
</attribute>
3284
</define>
7.10 index source styles
Some indices can gather index entries from paragraphs formatted using certain paragraph
styles. The <text:index-source-styles> element contains all of the <text:index-
source-style> elements for a particular outline level. The text:outline-levels attribute
determines at which outline level to list the index entries gathered from the respective paragraph
styles. There can only be one <text:index-source-style> element for each outline level.
3285
<define name="text-index-source-styles">
3286
<element name="text:index-source-styles">
3287
<attribute name="text:outline-level">
3288
<ref name="positiveInteger"/>
3289
</attribute>
3290
<zeroOrMore>
3291
<ref name="text-index-source-style"/>
3292
</zeroOrMore>
3293
</element>
3294
</define>
7.10.1 Index source style
All paragraphs formatted using the style or class specified in the <text:index-source-
style> element are included in the index.
3295
<define name="text-index-source-style">
3296
<element name="text:index-source-style">
3297
<attribute name="text:style-name">
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005. All Rights Reserved.
Page 169 of 706

3298
<ref name="styleName"/>
3299
</attribute>
3300
<empty/>
3301
</element>
3302
</define>
7.11 Index title template
The <text:index-title-template> element determines the style and content of the index
title. There can only be one <text:index-title-template> element contained in a
<text:table-of-content-source> element.
3303
<define name="text-index-title-template">
3304
<element name="text:index-title-template">
3305
<optional>
3306
<attribute name="text:style-name">
3307
<ref name="styleNameRef"/>
3308
</attribute>
3309
</optional>
3310
<text/>
3311
</element>
3312
</define>
7.12 Index Template Entries
There are eight types of index entries, as follows:

Chapter information

Entry text

Page number

Fixed string

Bibliography information

Tab stop

Hyperlink start and end
7.12.1 Chapter Information
The <text:index-entry-chapter> element displays the chapter number of the index entry.
The character style for the chapter number can be included in the index entry element as a
text:style-name attribute.
3313
<define name="text-index-entry-chapter">
3314
<element name="text:index-entry-chapter">
3315
<optional>
3316
<attribute name="text:style-name">
3317
<ref name="styleNameRef"/>
3318
</attribute>
3319
</optional>
3320
<ref name="text-index-entry-chapter-attrs"/>
3321
</element>
3322
</define>
Note: This element can only display the chapter number. To display the chapter
name, the <text:index-entry-text> elements must be used.
OpenDocument-v1.0-os.sxw
1 May 2005
Copyright © OASIS Open 2002 - 2005.