Chapter 2. The meta.xml, styles.xml, settings.xml, and content.xml Files

Though content.xml is king, monarchs rule better when surrounded by able assistants. In an OpenDocument JAR file, these assistants are the meta.xml, style.xml, and settings.xml files. In this chapter, we will examine the assistant files, and then describe the general structure of the content.xml file.

The only files that are actually necessary are content.xml and the META-INF/manifest.xml file. If you create a file that contains word processor elements and zip it up and a manifest that points to that file, OpenOffice.org will be able to open it successfully. The result will be a plain text-only document with no styles. You won't have any of the meta-information about who created the file or when it was last edited, and the printer settings, view area, and zoom factor will be set to the OpenOffice.org defaults.

The settings.xml File

The settings.xml file contains information intended for use exclusively by the application that created the file. From the viewpoint of an external application, there's very little of use in this file, so we'll just take a brief look at it before bidding it a fond farewell.

The root element, <office:document-settings> contains a <office:settings> element, which in turn contains one or more <config:config-item-set> entries. Each of these contains one or more items, named item maps,indexed item maps, or other <config:config-item-set>s.

Configuration Items

The <config:config-item> ...

Get OASIS OpenDocument Essentials: Using OASIS OpenDocument XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.