Chapter 14 of OpenDocument 1.3 part 3, “Common content”, defines pieces that can appear in any kind of document: comments, event bindings, MathML formulas and DDE links. This page covers all of it.
Comments
A comment is an office:annotation placed in the text where it applies.
Its own text is in text:p and text:list children, after
optional dc:creator (author), dc:date (when),
meta:creator-initials (author’s initials) and
meta:date-string (a date kept as typed, for display only).
In a presentation this means comments sit in the text of a shape: ODF 1.3 allows
office:annotation only inside text:p, text:h,
text:span, text:a, text:meta,
text:meta-field, text:ruby-base and table cells, not
directly in a draw:page.
To comment on a range, give the annotation an office:name and put an
office:annotation-end with the same name where the range ends; the
name must be unique to that pair. An end with no matching start before it is
ignored.
| Attribute | Values | Meaning |
|---|---|---|
office:name | text | Pairs the start with its office:annotation-end. |
office:display | true, false | Whether the comment is shown. |
svg:x, svg:y, svg:width, svg:height | coordinates, lengths | Position and size of the box that shows the comment, as for a caption shape. |
draw:caption-point-x, draw:caption-point-y | coordinates | The point the box’s line leads to. |
draw:style-name, draw:class-names, draw:text-style-name, draw:corner-radius, draw:transform, draw:z-index, draw:layer | as for shapes | Look of the box (a graphic style). |
draw:name | text | Deprecated in favour of office:name. |
text:anchor-type, text:anchor-page-number, table:end-cell-address, table:end-x, table:end-y, table:table-background, presentation:style-name, presentation:class-names, xml:id, draw:id | as for shapes | Anchoring and identifiers. |
<text:p>The <office:annotation office:name="c1">
<dc:creator>A. Writer</dc:creator><dc:date>2024-05-01T10:15:00</dc:date>
<text:p>Check this figure.</text:p>
</office:annotation>sales figure<office:annotation-end office:name="c1"/> rose.</text:p>
Events and macros
Controls, images, text boxes, shapes or the whole document can react to events. An
office:event-listeners element holds one child per event-to-action
binding: script:event-listener for a macro or script, or
presentation:event-listener for a presentation action.
| Attribute of script:event-listener | Values | Meaning |
|---|---|---|
script:event-name | prefix, colon, event name | The event. Writers should use DOM Level 2 event names where they fit, with a prefix bound to http://www.w3.org/2001/xml-events. Other events are implementation-defined. |
script:language | prefix, colon, name | The script language (names are implementation-dependent). |
script:macro-name | text | The macro by name; its meaning depends on the language. |
xlink:href | IRI | Or the macro as an IRI (schemes depend on the language); xlink:type="simple", xlink:actuate="onRequest". |
| script:event-name | HTML | When |
|---|---|---|
dom:change | onchange | A control loses focus after its value changed. |
dom:DOMFocusIn | onfocus | A control gains focus by mouse or Tab. |
dom:DOMFocusOut | onblur | A control loses focus. |
dom:mousedown | onmousedown | A mouse button is pressed on a control. |
dom:mouseup | onmouseup | A mouse button is released on a control. |
dom:mousemove | onmousemove | The pointer moves onto a control. |
dom:mouseover | onmouseover | The pointer moves over a control. |
dom:mouseout | onmouseout | The pointer moves away from a control. |
dom:reset | onreset | A form is reset. |
dom:submit | onsubmit | A form is submitted. |
(dom stands for whatever prefix is bound to the xml-events namespace.)
Formulas
math:math holds MathML 2.0 content. It appears inside a
draw:object in a frame (see
shapes, frames and
3D); the frame should also hold an image of the object.
DDE links
Dynamic Data Exchange connects content to another program, by application, topic (such as a file name) and item (what to deliver). Every connection is named. Anything that uses DDE must also store its last content, so the document still shows correctly where DDE is not available; readers should keep the connection data even if they cannot use it. DDE exists only on some operating systems.
| Element | Meaning | Attributes |
|---|---|---|
text:dde-connection-decls | Holds the declarations, in text documents. | – |
text:dde-connection-decl | A connection used by DDE fields (text:dde-connection), which refer to it by name. | office:name, office:dde-application, office:dde-topic, office:dde-item, office:automatic-update (default true; false: only when the user asks) |
office:dde-source | Links a table or a section (as its child) through DDE, or gives the connection of a table:dde-link. | as above, plus office:conversion-mode = into-default-style-data-style (default: numbers in the default style’s data style), into-english-number, keep-text (treated as text) |
table:dde-link | Spreadsheets: DDE data for formulas, with an office:dde-source and an unnamed, unstyled table:table caching the values in its cell attributes. | – |
Source
OpenDocument Version 1.3, OASIS Standard, 27 April 2021, part 3 (schema), chapter 14 and attributes 19.370–19.378 and 19.433–19.435 (Table 15, script events); read in full for this page. Forms (chapter 13) are not described on this site yet.