Content deleted Content added
→Document Representation: added small info about Flat ODF being supported or not on other softwares |
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5 |
||
(48 intermediate revisions by 33 users not shown) | |||
Line 1:
{{OpenDocument}}
This article describes the '''technical specifications of the [[OpenDocument]] office document standard''', as developed by the [[OASIS (organization)|OASIS]] industry consortium. A variety of organizations developed the standard publicly and make it publicly accessible, meaning it can be implemented by anyone without restriction. The OpenDocument format aims to provide an open alternative to [[proprietary format|proprietary]] document formats.
== Document representation ==
The OpenDocument format supports the following two ways of document representation:
* As a '''collection of several sub-documents within a package''', each of which stores part of the complete document. This is the common representation of OpenDocument documents. It uses filename extensions such as <code>.odt</code>, <code>.ott</code>, <code>.ods</code>, <code>.odp</code> ... etc. The package is a standard [[ZIP (file format)|ZIP file]] with different filename extensions and with a defined structure of sub-documents. Each sub-document within a package has a different document root and stores a particular aspect of the XML document. All types of documents (e.g. text and spreadsheet documents) use the same set of document and sub-document definitions.
* As a '''single XML document'''
The recommended filename extensions and [[MIME]] types are included in the official standard (OASIS, May 1, 2005, and its later revisions or versions). The MIME types and extensions contained in the ODF specification are applicable only to office documents that are contained in a package. Office documents that conform to the OpenDocument specification but are not contained in a package should use the MIME type text/xml.
The MIME type is also used in the <code>office:mimetype</code> attribute. It is very important to use this attribute in flat XML files/single XML documents, where this is the only way the type of the document can be detected (in a package, the MIME type is also present in a separate file ''mimetype''). Its values are the MIME types that are used for the packaged variant of office documents.
==
The most common file extensions used for OpenDocument documents are <code>.odt</code> for text documents, <code>.ods</code> for spreadsheets, <code>.odp</code> for presentation programs, and <code>.odg</code> for graphics. These are easily remembered by considering ".od" as being short for "OpenDocument", and then noting that the last letter indicates its more specific type (such as t for text).
Here is the complete list of document types, showing the type of file, the recommended file extension, and the [[MIME]] Type:
{| class="wikitable"
! File type
! Extension
Line 68 ⟶ 62:
|1.0
|-
|rowspan=3|Database
|rowspan=3|.odb
|application/vnd.sun.xml.base<ref>{{citation |url=http://dlc.sun.com/osol/jds/downloads/sources/defaults.list |title=MIME types - OpenSolaris Default Applications |accessdate=2010-06-06 |url-status=dead |archiveurl=https://web.archive.org/web/20110716163416/http://dlc.sun.com/osol/jds/downloads/sources/defaults.list |archivedate=2011-07-16 }}</ref><ref>{{citation |url=http://extension.nirsoft.net/odb |title=.odb Extension - List of programs that can open .odb files |accessdate=2010-06-06}}</ref>
|not defined in ODF 1.0/1.1 specifications;<br>used in OpenOffice.org 2.x
|-
|application/vnd.oasis.opendocument.base
|ODF 1.2;<br>used in OpenOffice.org 3.x
|-
|application/vnd.oasis.opendocument.database
|defined in [
|-
|all OpenDocument single/flat XML files
Line 89 ⟶ 79:
|}
==
OpenDocument also supports a set of template types. Templates represent formatting information (including styles) for documents, without
the content themselves. The recommended filename extension begins with ".ot" (interpretable as short for "OpenDocument template"), with the last letter indicating what kind of template (such as "t" for text). The supported set includes:
{| class="wikitable"
! File type
! Extension
Line 146 ⟶ 132:
==Capabilities==
As noted above, the OpenDocument format can describe text documents (for example, those typically edited by a word processor), spreadsheets, presentations, drawings/graphics, images, charts, mathematical formulas, and "master documents" (which can combine them). It can also represent templates for many of them.
Line 152 ⟶ 137:
===Metadata===
The OpenDocument format supports storing [[metadata]] (data about the data) by having a set of pre-defined
metadata elements, as well as allowing user-defined and custom metadata.
Line 177 ⟶ 161:
===Content===
OpenDocument's text content format supports both typical and advanced capabilities. Headings of various levels, lists of various kinds (numbered and not), numbered paragraphs,
and change tracking are all supported. Page sequences and section attributes can be used to control how the text is displayed. Hyperlinks, [[ruby text]] (which provides annotations and is especially critical for some languages), bookmarks, and references are supported as well. Text fields (for autogenerated content), and mechanisms for automatically generating
tables such as tables of contents, indexes, and bibliographies, are included as well.
The OpenDocument format implements spreadsheets as sets of tables. Thus it features extensive capabilities for formatting the display of tables and spreadsheets. OpenDocument also supports database ranges, filters, and "data pilots" (known in Microsoft Excel contexts as "[[pivot table]]s"). Change tracking is available for spreadsheets as well.
The graphics format supports a vector graphic representation, in which a set of layers and the contents [https://web.archive.org/web/20051212150956/http://www.auton.nl/software/apps/adms/en/adms.html] of each layer is defined. Available drawing shapes include Rectangle, Line, Polyline, Polygon, Regular Polygon, Path, Circle, Ellipse, and Connector. 3D Shapes are also available; the format includes information about the Scene, Light, Cube, Sphere, Extrude, and Rotate (it is intended for use as for office data exchange, and not sufficient to represent videos or other extensive 3D scenes). Custom shapes can also be defined.
Presentations are supported. Users can include animations in presentations, with control over the sound, showing a shape or text, hiding a shape or text, or dimming something, and these can be grouped. In OpenDocument, much of the format capabilities are reused from the text format, simplifying implementations. However, tables are not supported within OpenDocument as drawing objects, so may only be included in presentations as embedded tables.
Charts define how to create graphical displays from numerical data. They support titles, subtitles, a footer, and a legend to explain the chart. The format defines the series of data that is to be used for the graphical display, and a number of different kinds of graphical displays (such as line charts, pie charts, and so on).
Forms are specially supported, building on the existing XForms standard.
Line 215 ⟶ 177:
====Objects====
A document in OpenDocument format can contain two types of objects, as follows:
* Objects that have an OpenDocument representation. These objects are:
** Formulas (represented as MathML)
Line 222 ⟶ 185:
** Drawings
** Presentations
* Objects that do not have an XML representation
Use of Microsoft Object Linking and Embedding (OLE) objects limits the interoperability, because these objects are not widely supported in programs for viewing or editing files (e.g. embedding of other files inside the file, such as tables or charts from a spreadsheet application in a text document or presentation file).<ref>{{cite web |url=
===Formatting===
The style and formatting controls are numerous, providing a number of controls over the display of information.
Page layout is controlled by a variety of attributes. These include page size, number format, paper tray, print orientation, margins, border (and its line width), padding, shadow, background, columns, print page order, first page number, scale, table centering, maximum footnote height and separator, and many layout grid properties.
Headers and footer can have defined fixed and minimum heights, margins, border line width, padding, background, shadow, and dynamic spacing.
There are many attributes for specific text, paragraphs, [[ruby text]], sections, tables, columns, lists, and fills. Specific characters can have their fonts, sizes, generic font family names (''roman''{{snd}} [[serif]], ''swiss''{{snd}} [[sans-serif]], ''modern''{{snd}} [[monospaced font|monospace]], ''decorative'', ''script'' or ''system''), and other properties set. Paragraphs can have their vertical space controlled through attributes on keep together, widow, and orphan, and have other attributes such as "drop caps" to provide special formatting.
The list is extremely extensive; see the references (in particular the actual standard) for details.
===Spreadsheet formulas===
OpenDocument version 1.2 fully describes mathematical formulas displayable on-screen. It is fully capable of exchanging spreadsheet data, formats, [[pivot table]]s, and other information typically included in a spreadsheet. OpenDocument exchanges formulas as values of the attribute table:formula.
The allowed syntax of table:formula was not defined in sufficient detail in the OpenDocument version 1.0 specification, which defined spreadsheet formulas using a set of simple examples showing, for example, how to specify ranges and the SUM() function. The [[OASIS (organization)|OASIS]] OpenDocument Formula sub group therefore standardized the table:formula in the [[OpenFormula]] specification. For more information
===
When an OpenDocument file is password protected the file structure of the bundle remains the same, but contents of XML files in the package are encrypted using the following algorithm:
# The file contents are compressed with the [[DEFLATE]] algorithm.
# A checksum of a portion of the compressed file is computed (SHA-1 of the file contents, or SHA-1 of the first 1024 bytes of the file, or SHA-256 of the first 1024 bytes of the file) and stored, so password correctness can be verified when decrypting.
# A digest (hash) of the user-entered password in UTF-8 encoding is created and passed to the package component. ODF versions 1.0 and 1.1 only mandate support for the SHA-1 digest here, while version 1.2 recommends SHA-256.
# This digest is used to produce a derived key by undergoing [[key stretching]] with [[PBKDF2]] using HMAC-SHA-1 with a salt of arbitrary length (in ODF 1.2; it's 16 bytes in ODF 1.1 and below) generated by the random number generator for an arbitrary iteration count (1024 by default in ODF 1.2).
# The random number generator is used to generate a random initialization vector for each file.
# The initialization vector and derived key are used to encrypt the compressed file contents. ODF 1.0 and 1.1 use Blowfish in 8-bit cipher feedback mode, while ODF 1.2 considers it a legacy algorithm and allows [[Triple DES]] and [[Advanced Encryption Standard|AES]] (with 128, 196 or 256 bits), both in cipher block chaining mode, to be used instead.
==Format internals==
An OpenDocument file commonly consists of a standard [[ZIP (file format)|ZIP]] archive ([[JAR (file format)|JAR]] archive<ref>{{cite web |last=Sobhi |first=Ali |date=2007-08-14 |orig-date=August 2006 |title=Introduction to OpenDocument Format |publication-place=Armonk, New York, United States |publisher=[[IBM]] |url=http://www-03.ibm.com/able/resources/odfintro.html |archive-url=https://web.archive.org/web/20080602152400/http://www-03.ibm.com/able/resources/odfintro.html |url-status=dead |archive-date=2008-06-02}}</ref>) containing a number of files and directories; but OpenDocument file can also consist only of a single XML document. An OpenDocument file is commonly a collection of several subdocuments within a (ZIP) ''package''. An OpenDocument file as a ''single XML'' is not widely used.
According to the OpenDocument 1.0 specification, the ZIP file specification is defined in ''Info-ZIP Application Note 970311, 1997''.<ref>{{cite web |url=http://tools.oasis-open.org/issues/browse/OFFICE-2205 |title=NEEDS-DISCUSSION: ZIP reference - N 1309 |access-date=2010-06-07}}</ref><ref>{{cite web |url=http://tools.oasis-open.org/issues/browse/OFFICE-2082 |title=Zip reference is neither public nor authoritative |date=2009-10-11 |access-date=2010-06-07}}</ref>
The simple compression mechanism used for a package normally makes OpenDocument files significantly smaller than equivalent Microsoft "<code>.doc</code>" or "<code>.ppt</code>" files. This smaller size is important for organizations who store a vast number of documents for long periods of time, and to those organizations who must exchange documents over low bandwidth connections. Once uncompressed, most data is contained in simple text-based XML files, so the uncompressed data contents have the typical ease of modification and processing of XML files. The standard also allows for the creation of a single XML document, which uses ''<office:document>'' as the root element, for use in document processing.
The standard allows the inclusion of directories to store images, non-[[Synchronized Multimedia Integration Language|SMIL]] animations, and other files that are used by the document but cannot be expressed directly in the XML.
Due to the openly specified compression format used, it is possible for a user to extract the container file to manually edit the contained files. This allows repair of a corrupted file or low-level manipulation of the contents.
The zipped set of files and directories includes the following:
Line 286 ⟶ 241:
===content.xml===
'''content.xml''', the most important file, carries the actual content of the document (except for binary data, such as images). The base format is inspired by HTML, and though far more complex, it should be reasonably legible to humans:
<
<text:h style-name="Heading_2">This is a title</text:h>
<text:p style-name="Text_body"/>
Line 297 ⟶ 251:
is a blank paragraph (an empty line).
</text:p>
</syntaxhighlight>
===styles.xml===
'''styles.xml''' contains style information. OpenDocument makes heavy use of styles for formatting and layout. Most of the style information is here (though some is in content.xml). Styles types include:
* Paragraph styles
* Page styles
Line 310 ⟶ 265:
===meta.xml===
'''meta.xml''' contains the file metadata. For example, Author, "Last modified by", date of last modification, etc. The contents look somewhat like this:
<
<meta:creation-date>2003-09-10T15:31:11</meta:creation-date>
<dc:creator>Daniel Carrera</dc:creator>
Line 323 ⟶ 277:
image-count="2" word-count="16701"
character-count="98757"/>
</syntaxhighlight>
The names of the <dc:...> tags come from the [[Dublin Core]] XML standard.
Line 331 ⟶ 285:
===mimetype (file)===
'''mimetype''' is just a one-line file with the mimetype of the document. One implication of this is that the file extension is actually immaterial to the format. The file extension is only there for the benefit of the user. It is important to note that this special file is always the first file entry in the ZIP archive and it is uncompressed. Because the ZIP header uses fields with fixed lengths, this allows the direct identification of the different OpenDocument formats without decompression of the content (e. g. with magic bytes).
===Thumbnails (directory)===
'''Thumbnails''' is a separate folder for a document thumbnail. The thumbnail must be saved as “thumbnail.png”. A thumbnail representation of a document should be generated by default when the file is saved. It should be a representation of the first page, first sheet, etc. of the document. The required size for the thumbnails is 128x128 pixel. In order to conform to the [
===META-INF (directory)===
META-INF is a separate folder. Information about the files contained in the OpenDocument package is stored in an XML file called the manifest file. The manifest file is always stored at the pathname META-INF/manifest.xml. The main pieces of information stored in the manifest are:
* A list of all of the files in the package.
* The media type of each file in the package.
Line 350 ⟶ 305:
Although not fully reusing [[Scalable Vector Graphics|SVG]] for [[vector graphics]], OpenDocument does use SVG-compatible vector graphics within an ODF-format-specific namespace, but also includes non-SVG graphics.
==
* Version 1.0 became an OASIS Standard on 2005-05-01;<ref>
{{cite web
| url
| title
| work
| publisher
| accessdate
| quote = Open Document
}}
</ref>
* Version 1.1 became an OASIS Standard on 2007-02-07;<ref>
{{cite web
| url
| title = OASIS Open Document Format for Office Applications (OpenDocument) TC
| work
| publisher
| accessdate
| quote = Open Document
}}
</ref>
* Version 1.2 became an OASIS Standard on 2011-09-29;<ref name="odf12">
{{cite web
| url = http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office
| title = OASIS Open Document Format for Office Applications (OpenDocument) TC
| work = OASIS website
| publisher = OASIS
| accessdate = 2024-11-26
| quote = Open Document Format v1.2 was approved as a OASIS Standard on 29 September 2011.
}}
</ref>
* Version 1.3 became an OASIS Standard on 2021-04-27.<ref>
{{cite web
| url = http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=office
| title = OASIS Open Document Format for Office Applications (OpenDocument) TC
| work = OASIS website
| publisher = OASIS
| accessdate = 2024-11-26
| quote = Open Document Format for Office Applications (OpenDocument) Version 1.3 OASIS Standard was approved by the members of OASIS on 27 April 2021.
}}
</ref>
==
To indicate which version of the OpenDocument specification a file complies with, all root elements take an <code>office:version</code> attribute
===ODF 1.0/1.1===
It is not mandatory to use <code>office:version</code> attribute in ODF 1.0 and ODF 1.1 files, so when an element has office:version omitted, the element is based on ODF 1.0 or 1.1. If the file has a version known to an XML processor, it may validate the document. Otherwise, it is optional to validate the document, but the document must be well formed
===ODF 1.2 and newer===
The <code>office:version</code> attribute shall be present in each and every <office:document>, <office:document-content>, <office:document-styles>, <office:document-meta>, and <office:document-settings> element in the XML documents that comprise an OpenDocument 1.2 or newer document. The value of the office:version attribute shall
==Conformance==
===ODF
The OpenDocument specification does not specify which elements and attributes conforming applications must, should, or may support. Even typical office applications may only support a subset of the elements and attributes defined in the specification. The specification contains a non-normative table that provides an overview which element and attributes usually are supported by
typical office application.
Line 397 ⟶ 369:
Conforming applications shall read documents containing processing instructions and should preserve them.
===
ODF 1.2 defines precisely the conformance needs. The specification defines conformance for documents, consumers, and producers, with two conformance classes called conforming and extended conforming. It further defines conforming text, spreadsheet, drawing, presentation, chart, image, formula and database front end documents. Chapter 2 defines the basic requirements for the individual conformance targets.<ref>
{{cite web |url=http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2-part1.html#__RefHeading__440342_826425813 |title=Conformance defined in OpenDocument Version 1.2, Part 1, 29 September 2011 |accessdate=2012-12-05}}</ref>
==
{{Reflist}}
==References==
{{Refbegin}}
* [https://
* [https://
* [https://
* [https://docs.oasis-open.org/office/v1.1/ OpenDocument 1.1 specification] in ODT, HTML and PDF formats
* [https://docs.oasis-open.org/office/v1.0/ OpenDocument 1.0 specification] in PDF format
{{Refend}}
==External links==
* [https://web.archive.org/web/20060305030506/http://www.oooforum.org/forum/viewtopic.phtml?t=27452 Discussion of a Linux
* [
* [
{{DEFAULTSORT:Opendocument Technical Specification}}
|