1

It was my understanding that an ODT file was a ZIP file that contains various files that comprise an OpenOffice / LibreOffice document. However, I was running a script to search through these files when I noticed that I was getting an error from some of my ODT files about an end of central directory signature not being found. When I looked at these files I discovered that they were in fact plain XML.

Is this expected? What determines whether ZIP or XML is used? Is there some mechanism I can use to easily determine which type of file an ODT file is, aside from simple checking if unzip fails?

Michael
  • 1,195

1 Answers1

1

Cause

Using the included "Save as..." option, content created in Writer can either be saved as:

  1. ...an application/vnd.oasis.opendocument.text file with an .ODT extension, which is a valid application/zip file; and:

  2. ...an application/xml file with .FODT as its file extension.

This is determined by which option the user chooses in the (portal) file picker modal window.

Purpose

The purpose of the ZIP version is to ensure that all resources are self-contained and compressed, whereas the purpose of the XML version is to be atomically reversible in source control.