summaryrefslogtreecommitdiffstats
path: root/doc/kword/techinfo.docbook
blob: a2a7dd85baabdb48540ae10933337cfa7f4d94e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<sect1 id="kword-file-format">
<sect1info>
<authorgroup>
<author>
<firstname>Mike</firstname>
<surname>McBride</surname>
</author>
<!-- TRANS:ROLES_OF_TRANSLATORS -->
</authorgroup>
</sect1info>
<title>&kword; file format</title>
<indexterm><primary>&kword;</primary><secondary>file format</secondary></indexterm>

<para>&kword; uses two open source, independently developed standards for
its file format.  The combination was chosen for its balance between
convenience and open development models.</para>

<para>First, it should be noted that all &kword; files are multiple &XML;
files that are compressed to reduce their space requirements. </para>

<para>Select the &kword; version you are interested in:</para>
<itemizedlist>
<listitem><para><link linkend="kword-file-format-11">&kword; 1.1 and earlier</link>.</para></listitem>
<listitem><para><link linkend="kword-file-format-12">&kword; 1.2</link>.</para></listitem>
<listitem><para><link linkend="kword-file-format-13">&kword; 1.3</link>.</para></listitem>

</itemizedlist>

<sect2 id="kword-file-format-11">
<title>&kword; 1.1 and earlier</title>

<para>The &XML; files are compressed into a single file using the same
algorithm as used by <ulink
url="http://www.gnu.org/software/tar/tar.html"><application>tar</application></ulink>.</para>

<para>You can uncompress the files with the following command:</para>

<screen width="40">
<prompt>%</prompt> <userinput><command>tar -xzvf </command><replaceable>filename</replaceable></userinput>
</screen>

<para>This will expand the &kword; document file into its component
files.</para>

<para>The text portion of all &kword; files are &XML; (eXtensible Markup
Language) files.</para>

<note><para>For more information on &XML; documents, processors and
technology, please visit <simplelist> <member><ulink
url="http://www.w3.org/XML/">World Wide Web Consortium &XML;
pages</ulink></member> <member><ulink
url="http://www.xml.org/xml/resources_cover.shtml">XML.org Resource
Guide</ulink></member> <member><ulink url="http://www.ucc.ie/xml/">The &XML;
FAQ</ulink></member> </simplelist></para></note>

<para>All &kword; documents consist of at least two &XML; files:</para>

<variablelist>
<varlistentry>
<term><filename>maindoc.xml</filename></term>
<listitem>
<para>This file contains the bulk of the &kword; text, tables and formula
information. It is marked with &XML; tags according to the official DTD.  A
copy of the &kword; 1.1 DTD is located at: <ulink
url="http://www.koffice.org/DTD/kword-1.1.dtd">http://www.koffice.org/DTD/kword-1.1.dtd</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>documentinfo.xml</filename></term>
<listitem>
<para>This file contains the document information.  This is information
entered into the dialog boxes when selecting
<menuchoice><guimenu>File</guimenu><guimenuitem>Document
Information</guimenuitem> </menuchoice> from the menubar. This information
is useful for tracking authors, contact information &etc;</para>
<para>The DTD for &koffice; 1.1 is located at: <ulink
url="http://www.koffice.org/DTD/document-info-1.1.dtd">http://www.koffice.org/DTD/document-info-1.1.dtd</ulink>.</para>
</listitem>
</varlistentry>
</variablelist>

<para>In addition, there may be other files included in the &kword; document
file.  Pictures, embedded documents and other binary information are stored
within the &kword; document as separate files.</para>

<para>For more specific information on &kword; file storage or other
internal information, please see <ulink
url="http://www.koffice.org/developer">The KOffice API</ulink> and the
<ulink url="http://developer.kde.org">General &kde; developer information
pages</ulink>.</para>
</sect2>

<sect2 id="kword-file-format-12">
<title>&kword; 1.2</title>

<para>The text files are compressed into a single file using the same
algorithm as used by <ulink
url="http://www.info-zip.org/pub/infozip/Zip.html"><application>zip</application></ulink>.
This change was made because of its broad use in other open source office
suites and its improved performance with lower memory requirements.</para>
<para>You can uncompress the files with the following command:</para>

<screen width="40">
<prompt>%</prompt> <userinput><command>unzip </command><replaceable>filename</replaceable></userinput>
</screen>

<para>This will expand the &kword; document file into its component
files.</para> 

<para>The text portion of all &kword; files are &XML;
(eXtensible Markup Language) files.</para> 

<note><para>For more information on &XML; documents, processing and
technology, please visit <simplelist> <member><ulink
url="http://www.w3.org/XML/">World Wide Web Consortium &XML;
pages</ulink></member> <member><ulink
url="http://www.xml.org/xml/resources_cover.shtml">XML.org Resource
Guide</ulink></member> <member><ulink url="http://www.ucc.ie/xml/">The &XML;
FAQ</ulink></member> </simplelist></para></note>

<para>All &kword; documents consist of at least three files:</para>

<variablelist>
<varlistentry>
<term><filename>maindoc.xml</filename></term>
<listitem>
<para>This file contains the bulk of the &kword; text, tables and formula
information. It is marked with &XML; tags according to the official
DTD.</para> <para>A copy of the &kword; 1.2 DTD is located at: <ulink
url="http://www.koffice.org/DTD/kword-1.2.dtd">http://www.koffice.org/DTD/kword-1.2.dtd</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>documentinfo.xml</filename></term>
<listitem>
<para>This file contains the document information.  This is information
entered into the dialog boxes when selecting
<menuchoice><guimenu>File</guimenu><guimenuitem>Document
Information</guimenuitem> </menuchoice> from the menubar. This information
is useful for tracking authors, contact information etc.</para>
<para>The DTD for &koffice; 1.2 is located at: <ulink
url="http://www.koffice.org/DTD/document-info-1.2.dtd">http://koffice.kde.org/DTD/document-info-1.2.dtd</ulink>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><filename>mimetype</filename></term>
<listitem>
<para>This file contains the mimetype for &kword; files.  This information
is used by &kde; to determine that this is a &kword; file.</para>
<para>This file always contains:
<emphasis>application/x-kword</emphasis></para>
</listitem>
</varlistentry>

</variablelist>

<para>In addition, there may be other files included in the &kword; document
file.  Pictures, embedded documents and other binary information are stored
within the &kword; document as separate files.</para>

<para>For more specific information on &kword; file storage or other
internal information, please see <ulink
url="http://www.koffice.org/developer">The KOffice API</ulink> and the
<ulink url="http://developer.kde.org">General &kde; developer information
pages</ulink>.</para>

</sect2>
<sect2 id="kword-file-format-13">
<title>&kword; 1.3 (current version)</title>

<para>The text files are compressed into a single file using the same
algorithm as used by <ulink
url="http://www.info-zip.org/pub/infozip/Zip.html"><application>zip</application></ulink>.
This change was made because of its broad use in other open source office
suites and its improved performance with lower memory requirements.</para>
<para>You can uncompress the files with the following command:</para>

<screen width="40">
<prompt>%</prompt> <userinput><command>unzip </command><replaceable>filename</replaceable></userinput>
</screen>

<para>This will expand the &kword; document file into its component
files.</para> 

<para>The text portion of all &kword; files are &XML;
(eXtensible Markup Language) files.</para> 

<note><para>For more information on &XML; documents, processing and
technology, please visit <simplelist> <member><ulink
url="http://www.w3.org/XML/">World Wide Web Consortium &XML;
pages</ulink></member> <member><ulink
url="http://www.xml.org/xml/resources_cover.shtml">XML.org Resource
Guide</ulink></member> <member><ulink url="http://www.ucc.ie/xml/">The &XML;
FAQ</ulink></member> </simplelist></para></note>

<para>All &kword; documents consist of at least three files:</para>

<variablelist>
<varlistentry>
<term><filename>maindoc.xml</filename></term>
<listitem>
<para>This file contains the bulk of the &kword; text, tables and formula
information. It is marked with &XML; tags according to the official
DTD.</para> <para>A copy of the &kword; 1.3 DTD is located at: <ulink
url="http://www.koffice.org/DTD/kword-1.3.dtd">http://www.koffice.org/DTD/kword-1.3.dtd</ulink>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>documentinfo.xml</filename></term>
<listitem>
<para>This file contains the document information.  This is information
entered into the dialog boxes when selecting
<menuchoice><guimenu>File</guimenu><guimenuitem>Document
Information</guimenuitem> </menuchoice> from the menubar. This information
is useful for tracking authors, contact information etc.</para>
<para>The DTD for &koffice; 1.3 is located at: <ulink
url="http://www.koffice.org/DTD/document-info-1.3.dtd">http://koffice.kde.org/DTD/document-info-1.3.dtd</ulink>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><filename>mimetype</filename></term>
<listitem>
<para>This file contains the mimetype for &kword; files.  This information
is used by &kde; to determine that this is a &kword; file.</para>
<para>This file always contains:
<emphasis>application/x-kword</emphasis></para>
</listitem>
</varlistentry>

</variablelist>

<para>In addition, there may be other files included in the &kword; document
file.  Pictures, embedded documents and other binary information are stored
within the &kword; document as separate files.</para>

<para>For more specific information on &kword; file storage or other
internal information, please see <ulink
url="http://www.koffice.org/developer">The KOffice API</ulink> and the
<ulink url="http://developer.kde.org">General &kde; developer information
pages</ulink>.</para>

</sect2>
</sect1>