related tdf#150197 sw: NONE numbering still returns prefix/suffix
[LibreOffice.git] / xmloff / README.md
blob4c08c6b3164556d5dbf68bcb36898075386e2e2a
1 # ODF Import and Export Filter Logic
3 The main library "xo" contains the basic ODF import/export filter
4 implementation for most applications.  The document is accessed
5 via its UNO API, which has the advantage that the same import/export
6 code can be used for text in all applications (from/to Writer/EditEngine).
7 The filter consumes/produces via SAX UNO API interface (implemented in
8 "sax").  Various bits of the ODF filters are also implemented in
9 applications, for example `[git:sw/source/filter/xml]`.
11 There is a central list of all element or attribute names in
12 `[git:include/xmloff/xmltoken.hxx]`.  The main class of the import filter
13 is SvXMLImport, and of the export filter SvXMLExport.
15 The Import filter maintains a stack of contexts for each element being
16 read.  There are many classes specific to particular elements, derived
17 from SvXMLImportContext.
19 Note that for export several different versions of ODF are supported,
20 with the default being the latest ODF version with "extensions", which
21 means it may contain elements and attributes that are only in drafts of
22 the specification or are not yet submitted for specification.  Documents
23 produced in the other (non-extended) ODF modes are supposed to be
24 strictly conforming to the respective specification, i.e., only markup
25 defined by the ODF specification is allowed.
27 There is another library "xof" built from the source/transform directory,
28 which is the filter for the OpenOffice.org XML format.  This legacy format
29 is a predecessor of ODF and was the default in OpenOffice.org 1.x versions,
30 which did not support ODF.  This filter works as a SAX transformation
31 from/to ODF, i.e., when importing a document the transform library reads
32 the SAX events from the file and generates SAX events that are then
33 consumed by the ODF import filter.
35 [OpenOffice.org XML File Format](http://www.openoffice.org/xml/general.html)
37 There is some stuff in the "dtd" directory which is most likely related
38 to the OpenOffice.org XML format but is possibly outdated and obsolete.
40 ## Add New XML Tokens
42 When adding a new XML token, you need to add its entry in the following three
43 files:
45 * `[git:include/xmloff/xmltoken.hxx]`
46 * `[git:xmloff/source/core/xmltoken.cxx]`
47 * `[git:xmloff/source/token/tokens.txt]`