ddn.odf.math

ODF formula/math document body model.

Provides preservation-first access to office:formula content for OpenDocument Formula files (.odf).

Formula payloads are stored as raw MathML XML strings with optional typed helpers for common operations:

  • OdfFormulaBody wraps the MathML content string
  • parseFormulaBody() extracts the formula from an XML element
  • serializeFormulaBody() produces the <office:formula> element
  • Round-trip serialisation preserves MathML structure exactly

Types 1

Top-level model for office:formula body content.

The formula payload is stored as a raw XML string (MathML content) for maximum preservation.

Fields
string mathMarkup
XmlElement[] unknownElements
Methods
bool isEmpty() const @safe pure nothrowReturns `true` when the body has no formula markup.
string markup() const @safe pure nothrowReturns the raw MathML markup string.

Functions 6

fnOdfFormulaBody parseFormulaBody(XmlElement formulaElement)Parses an `office:formula` or `math:math` XML element into an `OdfFormulaBody`.
fnOdfFormulaBody parseFormulaString(string xml)Parses MathML markup from a raw XML string.
fnOdfFormulaBody emptyFormulaBody() @safe pure nothrowReturns an empty `OdfFormulaBody`.
fnstring serializeFormulaBody(const ref OdfFormulaBody body)Serialises an `OdfFormulaBody` to an XML fragment string.
fnOdfFormulaBody formulaBody(string markup) @safe pure nothrowConstructs an `OdfFormulaBody` from raw MathML markup.