blob: 45b78ae202f68fc0dd1a30b5f3c0ac76a1918195 [file] [log] [blame] [view]
Kohei Yoshidab5f50852017-05-11 23:31:26 -04001## Contains ODF import and export filter logic.
Michael Stahl4386a0d2013-03-11 21:16:46 +01002
3The main library "xo" contains the basic ODF import/export filter
4implementation for most applications. The document is accessed
5via its UNO API, which has the advantage that the same import/export
6code can be used for text in all applications (from/to Writer/EditEngine).
7The filter consumes/produces via SAX UNO API interface (implemented in
8"sax"). Various bits of the ODF filters are also implemented in
Kohei Yoshida624ec192017-05-19 20:43:04 -04009applications, for example [git:sw/source/filter/xml].
Michael Stahl4386a0d2013-03-11 21:16:46 +010010
11There is a central list of all element or attribute names in
Kohei Yoshidad1de2672017-05-19 21:11:02 -040012[git:include/xmloff/xmltoken.hxx]. The main class of the import filter
Michael Stahl4386a0d2013-03-11 21:16:46 +010013is SvXMLImport, and of the export filter SvXMLExport.
14
15The Import filter maintains a stack of contexts for each element being
16read. There are many classes specific to particular elements, derived
17from SvXMLImportContext.
18
19Note that for export several different versions of ODF are supported,
20with the default being the latest ODF version with "extensions", which
21means it may contain elements and attributes that are only in drafts of
22the specification or are not yet submitted for specification. Documents
23produced in the other (non-extended) ODF modes are supposed to be
Andrea Gelmini74117f92017-03-24 15:38:38 +010024strictly conforming to the respective specification, i.e., only markup
Michael Stahl4386a0d2013-03-11 21:16:46 +010025defined by the ODF specification is allowed.
26
27There is another library "xof" built from the source/transform directory,
28which is the filter for the OpenOffice.org XML format. This legacy format
29is a predecessor of ODF and was the default in OpenOffice.org 1.x versions,
30which did not support ODF. This filter works as a SAX transformation
31from/to ODF, i.e., when importing a document the transform library reads
32the SAX events from the file and generates SAX events that are then
33consumed by the ODF import filter.
34
Kohei Yoshida624ec192017-05-19 20:43:04 -040035[OpenOffice.org XML File Format](http://www.openoffice.org/xml/general.html)
Michael Stahl4386a0d2013-03-11 21:16:46 +010036
37There is some stuff in the "dtd" directory which is most likely related
38to the OpenOffice.org XML format but is possibly outdated and obsolete.
Kohei Yoshidab5f50852017-05-11 23:31:26 -040039
40### Add new XML tokens
41
42When adding a new XML token, you need to add its entry in the following three
43files:
44
Kohei Yoshida624ec192017-05-19 20:43:04 -040045* [git:include/xmloff/xmltoken.hxx]
46* [git:xmloff/source/core/xmltoken.cxx]
47* [git:xmloff/source/token/tokens.txt]
Kohei Yoshidab5f50852017-05-11 23:31:26 -040048