XML 文件格式

默认情况下,LibreOffice 以 OpenDocument 文件格式装入和保存文件。

批注图标

The OpenDocument file format (ODF) is a standardized file format used by many software applications. You can find more information at the Wikipedia site: wikipedia.org/wiki/OpenDocument.


OpenDocument 文件格式名称

LibreOffice 使用以下的文件格式:

文档格式

文件扩展名

ODF 文本

*.odt

ODF 文本模板

*.ott

ODF 主控文档

*.odm

HTML 文档

*.html

HTML 文档模板

*.oth

ODF 电子表格

*.ods

ODF 电子表格模板

*.ots

ODF 绘图

*.odg

ODF 绘图模板

*.otg

ODF 演示文稿

*.odp

ODF 演示文稿模板

*.otp

ODF 公式

*.odf

ODF 数据库

*.odb

LibreOffice 扩展

*.oxt


批注图标

HTML 格式不是 OpenDocument 格式。


独立图表的文件格式名为“ODF 图表”。该格式的 *.odc 扩展名目前未使用。

开放文档格式(OpenDocument format)的演进

OpenDocument 格式随着时间不断改进。

ODF 版本

OASIS 批准的标准日期

该软件的第一个支持版本

ODF 1.0

2005-05-01

OpenOffice.org 1.1.5 或 StarSuite 7

ODF 1.1

2007-02-02

OpenOffice.org 2.2 或 StarSuite 8 Update 4

ODF 1.2

2011-09-30

OpenOffice.org 3、StarOffice 9 或 Oracle Open Office

ODF 1.2(扩展)

-

OpenOffice.org 3.2 或 StarSuite 9.2


在 OpenOffice.org 3 和 StarSuite 9 中,您可以选择使用 ODF 1.2(默认)或 ODF 1.0/1.1(向后兼容)保存您的文档。选择工具 - 选项 - 加载/保存 - 常规并选择 ODF 格式的版本。

如果您想要与仍然使用 OpenOffice.org 1 或 StarSuite 7 的用户交换文档,请在文件类型列表框中使用分别指定的筛选器保存文档。

提示图标

如果需要将其他文档格式作为默认格式,请选择 - 加载和保存 - 常规,为每种 LibreOffice 文档类型选择替代的格式。


XML 文件结构

OpenDocument 文件格式的文档会以压缩的 zip 档案文件形式存储,并且包含 XML 文件。为查看这些 XML 文件,请使用 unzip 程序打开 OpenDocument 文件。在 OpenDocument 文件内会包含以下文件和目录:

  1. 文档的文本内容存储在 content.xml 中。

    By default, content.xml is stored without formatting elements like indentation or line breaks to minimize the time for saving and opening the document. The use of indentations and line breaks can be activated in the Expert configuration by setting the property /org.openoffice.Office.Common/Save/Document PrettyPrinting to true.

  2. meta.xml 文件含有文档的图元信息,可以在文件 - 属性中输入这些信息。

    如果保存文档时设置了密码,meta.xml 文档将不会被加密。

  3. settings.xml 文件中含有此文档设置的其他信息。

  4. In styles.xml, you find the styles applied to the document that can be seen in the Styles window.

  5. 文件meta-inf/manifest.xml描述了 XML 文件的结构。

此外,还可以压缩文件格式包含其他文件和文件夹。

XML 格式定义

OpenDocument 格式的模式可以在网站 www.oasis-open.org 中找到。