ddn.odf.content

Content body parsing and serialisation for ODF documents.

Handles the content.xml stream inside an ODF package, which contains the actual document content (text, tables, slides, etc.) along with automatic styles, font-face declarations, and scripts.

Types 3

Represents the office:scripts section of content.xml.

Scripts are preserved as raw XML.

Fields
XmlElement[] scriptElements
structOdfBody

Represents the body of an ODF document (office:body).

The body contains exactly one family-specific root element (office:text, office:spreadsheet, office:presentation, office:drawing, or office:chart).

Fields
XmlElement contentElementRaw XML element of the family-specific body content.
Methods
bool isEmpty() @safe pure nothrow constReturns `true` if the body is empty (no content element).

Represents the parsed content of an ODF content.xml stream.

Contains the body, automatic styles, font-face declarations, and scripts from the office:document-content root element.

Fields
OdfBody body
OdfStyles autoStyles
FontFace[] fontFaces
OdfScripts scripts
string version_
XmlElement[] unknownChildren
Methods
bool isEmpty() @safe pure nothrow constReturns `true` if this content has no body element.

Functions 7

fnOdfContent parseContent(const(ubyte)[] xmlBytes)Parses raw `content.xml` bytes into an `OdfContent` struct.
fnOdfContent parseContentString(string xml)Parses a `content.xml` string into an `OdfContent` struct.
fnstring serializeContent(const ref OdfContent content)Serialises an `OdfContent` back to an XML string.
private fnvoid serializeContentProps(XmlElement el, ref const StyleDefinition s)
private fnvoid parseStyleProps(XmlElement styleEl, ref StyleDefinition sd)
private fnvoid parseProperties(XmlElement el, ref StyleProperties props)