odox-core 0.2.0

Read and write OpenDocument text, spreadsheet and presentation packages
Documentation

OpenDocument, read and written: the package, its XML, its styles, and the three bodies that an ODF document can have.

Bytes in, bytes out

Nothing here opens a file. A [Package] is made from a byte slice and turned back into a Vec<u8>, which is what lets the same code serve a desktop window, a sandboxed macOS application that may only replace the file it was handed, a browser, and a test that never touches a disk.

What it does not understand, it keeps

The document is held as the XML tree it was parsed from, not as a summary of the parts this crate has opinions about. An element nobody here has heard of keeps its attributes, its children and its position, and is written back where it was found. A viewer does not need that; an editor built on a model that discarded the unread nine tenths of ODF would destroy every document it saved, and by then the model is load-bearing everywhere.

Typed reading is therefore a view over the tree rather than a replacement for it: [Styles] resolves a style name through its inheritance chain, and the three document types in [doc] index the body for the application that draws it.