OpenOffice .odt Opened Up – Part 1: Overview

Overview

In the first article in this series, OpenOffice ODF/.odt compared to Microsoft Word .doc, I compared various file types for size efficiency. Of particular interest was the fact that OpenOffice Write stores .odts in a zip format, an implementation of PKZip to be exact. With this knowledge and the Open Document Format standard, we can investigate how certain elements of a document effect its size and overall efficiency.

My test cases where produced with the following software:

  • SuSE Linux 10.1
  • OpenOffice 2.0.2.7.1
  • zip 2.31 (March 8th 2005)

Starting Out

As we previously observed, .odt documents are stored in ZIP format. It is possible to store the document as a single XML file that conforms to the OpenOffice.org document type definition (DTD). It is also possible to store the document as several subdocuments, each with a different document root that represents a particular aspect of the document, such as, content or style.
Quoting the Open Document Format for Office Applications (OpenDocument) v1.0 (Second Edition), (ODF Specification):

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 XML document. n/a
office:document-content Document content and automatic styles used in the content. content.xml
office:document-styles Styles used in the document content and automatic styles used in the styles themselves. styles.xml
office:document-meta Document meta information, such as the author or the time of the last save action. meta.xml
office:document-settings Application-specific settings, such as the window size or printer information. settings.xml

So, what is in our reference .odt? We will use the Linux produced document from a prior article (oo_part1.odt) with XML compression disabled. We’ve done this so that the XML is more human readable. After we unzip the file using the Linux utility unzip, we have the raw files as shown below.

.odt unzipped directory tree

As you can see all four subdocuments as specified in the specification are present as well as several other files. In particular META-INF/manifest.xml list the contents of the package, including information such as full path and type.

The file Thumbnails/thumbnail.png although part of the package, is not part of the document. The thumbnail image should conform to the Thumbnail Managing Standard (TMS) at www.freedesktop.org, and therefore should be24bit, non-interlaced PNG image with full alpha transparency. The required size for the thumbnails is 128×128 pixel.

Here is the thumbnail from our reference document.

thumbnail.png

Having the thumbnail available in the package, allows other applications such as file managers to preview the document to the user. With a little creative programming, sites such as Google, Yahoo or Ask, could extract this thumbnail and preview the document for users, with little difficulty.

Document Elements

The office:document may contain any of the document elements listed below.

  • office:document-attrs
  • office:document-common-attrs
  • office:meta
  • office:settings
  • office:scripts
  • office:font-face-decls
  • office:styles
  • office:automatic-styles
  • office:master-styles
  • office:body

When the subdocument method is used however, elements are restricted to certain subdocuments.

Elements in content.xml

  • office:document-content (subdocument root)
  • office:document-common-attrs
  • office:scripts
  • office:font-face-decls
  • office:automatic-styles
  • office:body

Elements in styles.xml

  • office:document-styles (subdocument root)
  • office:document-attrs
  • office:document-common-attrs
  • office:font-face-decls
  • office:styles
  • office:automatic-styles
  • office:master-styles

Elements in meta.xml

  • office:document-meta (subdocument root)
  • office:document-common-attrs
  • office:meta

Elements in settings.xml

  • office:document-settings (subdocument root)
  • office:document-common-attrs
  • office:settings

What’s Up Next?

At this point we have a clear understanding of the subdocument method that OpenOffice applies to its ODF implementation, and we know what top level elements are handled by each subdocument.

In the next article, we will ease into the subdocument elements by exploring the office:document-meta and office:document-settings elements. These two elements are rather simple and will not require as much review compared to office:document-content or office:document-styles.
Until next time.

-3Monkeys

Be Sociable, Share!
1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (9 votes, average: 6.67 out of 10)
Loading ... Loading ...

24 Responses to “OpenOffice .odt Opened Up – Part 1: Overview”

  1. ralamosm Says:

    Nice article that brings order to something I partially knew some years ago because a problem I had with an OO document. The problem was that I was working on a very important OO document and suddenly my PC rebooted without reason and the file get corrupted after that. Some friend told me that OO documents where just XML stored in ZIP format so I could easily fix that file by myself just editing the XML.

    If you use OO for important files, read this article (and the first one). It can save your life.

    Good work 3monkeys :)

  2. 1st anniversary Says:

    I really like your writing style, good info, regards for putting up :D. “Nothing sets a person so much out of the devil’s reach as humility.” by Johathan Edwards.

  3. Ollie Voelkerding Says:

    Thanks for your article. I also feel that laptop computers have become more and more popular right now, and now in many cases are the only kind of computer found in a household. It is because at the same time they are becoming more and more affordable, their working power is growing to the point where these are as powerful as personal computers coming from just a few in years past.

  4. online translator Says:

    At this time it sounds like Expression Engine is the preferred blogging platform out there right now. (from what I’ve read) Is that what you are using on your blog?

  5. swift sterling pounds till payday Says:

    I’m extremely pleased to discover this great site. I need to to thank you for your time for this particularly wonderful read!! I definitely appreciated every little bit of it and i also have you saved to fav to check out new stuff in your website.

  6. Rutha Dipaolo Says:

    Bien le bonjour ! Il s’agit vraiment d’ un extraordinaire post, je te remercie de l’avoir partagé. Pour te remercier, cadeau, une ligne pour pouvoir exécuter du card sharing : F: ned431eGRHGb ned431eQGGQb 2 0 0 0:0:1,100:3317 #neder 29/10/2010 . C’est sans frais, alors n’hésites pas à l’utiliser et la partager. Bonne journée

  7. dexters laboratory Says:

    Somebody essentially help to make seriously articles I’d state. That is the first time I frequented your website page and up to now? I amazed with the research you made to make this actual post incredible. Great task!

  8. lbs . until payday Says:

    Very good article. I certainly appreciate this site.
    Keep writing!

  9. Heyward@gmail.com Says:

    Great post. I was checking constantly this weblog and I’m impressed! Very helpful information particularly the remaining section :) I take care of such information a lot. I used to be seeking this particular information for a very long time. Thank you and best of luck.

  10. Decree@gmail.com Says:

    Very fantastic visual appeal on this web site, I’d rate it 10.

  11. Bonusy bukmacherskie Says:

    I think everything posted made a bunch of sense. However, think on this, what if you added a little information? I am not saying your information isn’t solid., however suppose you added something to maybe grab folk’s attention? I mean 3monkeys » OpenOffice .odt Opened Up – Part 1: Overview is a little plain. You might peek at Yahoo’s front page and watch how they write post headlines to grab viewers interested. You might add a video or a picture or two to get people interested about everything’ve written. Just my opinion, it would bring your posts a little bit more interesting.

  12. Kole Carrea Says:

    I absolutely love your blog and find most of your post’s to be just what I’m looking for. Would you offer guest writers to write content for you personally? I wouldn’t mind creating a post or elaborating on many of the subjects you write concerning here. Again, awesome blog!

  13. Meagan Volkmer Says:

    The subsequent time I read a blog, I hope that it doesnt disappoint me as a lot as this one. I mean, I do know it was my option to learn, but I really thought youd have something fascinating to say. All I hear is a bunch of whining about something that you might fix for those who werent too busy searching for attention.some tips here!

  14. Aline Utecht Says:

    Iuvare y Xango son la mejor opcion que puedes tomar

  15. Keenan Capley Says:

    El sistema de capacitación dentro de Iuvare es extraordinario, porque te impulsa a alcanzar tus limites, a superarte cada dia, a tener la visión y capacidad de elegir con quien quieres asociarte y a dar lo mejor en cada área de tu vida, no nada mas en Xango.

  16. newsy Says:

    My husband and i felt absolutely satisfied John could finish up his investigations out of the precious recommendations he received from your weblog. It’s not at all simplistic to just choose to be giving freely techniques the others might have been making money from. We discover we have got the website owner to appreciate because of that. The type of explanations you made, the straightforward website menu, the friendships you give support to promote – it is most remarkable, and it is letting our son in addition to us feel that the subject is enjoyable, which is rather important. Thank you for the whole thing!

  17. Arlie Scierka Says:

    I have noticed that intelligent real estate agents everywhere you go are getting set to FSBO Promoting. They are recognizing that it’s not only placing a sign post in the front area. It’s really pertaining to building human relationships with these sellers who later will become purchasers. So, while you give your time and effort to serving these retailers go it alone — the “Law of Reciprocity” kicks in. Interesting blog post.

  18. Diets That Work Says:

    I’d like to thank you for the efforts you’ve put in writing this website. I really hope to see the same high-grade content from you in the future as well. In truth, your creative writing abilities has inspired me to get my own blog now ;)

  19. healthy living Says:

    |Hello! I just would like to give a huge thumbs up for the great info you have here on this post. I will be coming back to your blog for more soon.

  20. The Secrets To Herb Growing Says:

    Having read this I thought it was very enlightening. I appreciate you taking the time and energy to put this information together. I once again find myself spending way too much time both reading and posting comments. But so what, it was still worthwhile!

  21. safelists Says:

    {I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post.

  22. free computer ebook Says:

    Ordinarily I would not understand write-up for weblogs, however i would like to claim that that write-up really urged my family to undertake that! Your current writing style have been astonished me. Thanks a lot, very good post.

  23. do pobrania Says:

    Great post! We are linking to this particularly great content on our website. Keep up the great writing.

  24. ceramika artystyczna in boleslawiec poland Says:

    You’ve made some really good points there. I checked on
    the internet to find out more about the issue and found most people will go
    along with your views on this web site.

Leave a Reply