Warning, /office/calligra/filters/libodfreader/README is written in an unsupported language. File is not indexed.
0001 This directory contains the odf reader library. 0002 0003 The purpose of this library is to traverse the contents of an ODF file 0004 using so called XML stream reading. The library contains a recursive 0005 descent parser for ODF contents. At the time of this writing only an 0006 ODT parser is available but later we will provide parsers for all of 0007 the ODF document types. Much of the actual contents use the same XML 0008 elements so supporting a new document type is not a lot of work. 0009 0010 During the parsing, functions are called in a backend class that the 0011 programmer should subclass in order to provide specific output from the 0012 parser. A so called reader context (OdfReaderContext) is maintained and passed 0013 to all functions in the backend class. This class should also be subclassed. 0014 For a very simple example, see the text export filter in 0015 filters/words/ascii/AsciiExport.cpp. 0016 0017 0018 About Stream Reading 0019 -------------------- 0020 0021 The classes in this library are all based on KoXmlStreamReader which 0022 is a source compatible subclass of QXmlStreamReader. Stream reading an 0023 XML file is much more efficient than DOM parsing since it reads the 0024 XML data as a stream (as indicated by the name) and does not build any 0025 elaborate data structure. It is also easier to use than the third 0026 alternative, SAX parsing. 0027 0028 Qt have classes to help whichever of these 3 methods you want to use but for 0029 our purposes stream reading is the most appropriate.