ddn.odf.compat

Compatibility layer for ODF documents from common office suites.

Detects ODF version differences, identifies generator suites, handles namespace variations, and reports version-specific compatibility notes through diagnostics.

Supported suites

  • LibreOffice (all versions)
  • Apache OpenOffice
  • Calligra
  • Google Docs (Google Drive exports)
  • Microsoft Office (ODF export)
  • KOffice / NeoOffice

Version handling

  • Detects ODF versions 1.0 through 1.4
  • Reports unsupported versions as diagnostics
  • Provides OdfCompatibilityTarget for target version selection

Compatibility notes

  • Namespace prefix variations between generators
  • Non-standard meta:generator strings
  • Default attribute value differences
  • Extension namespace handling

Types 4

Known ODF specification versions.

ODF 1.2, 1.3, and 1.4 are fully supported. Legacy versions (1.0, 1.1) are detected and reported through diagnostics but content is preserved.

UNKNOWNVersion is not specified or could not be determined.
V1_0ODF 1.0 (legacy, used by early OpenOffice.org).
V1_1ODF 1.1 (used by older OpenOffice and some legacy suites).
V1_2ODF 1.2 (fully supported).
V1_3ODF 1.3 (fully supported with change tracking, RDF metadata).
V1_4ODF 1.4 (fully supported; LibreOffice 25.x default).

Result of a compatibility check against an ODF document.

Fields
OdfVersion detectedVersionThe detected ODF version from the document.
string versionStringThe version string as found in the document (e.g. `"1.4"`).
bool isFullySupportedWhether the detected version is fully supported.
string generatorOptional suite identification from `meta:generator`.

Known ODF generator suites.

UNKNOWN
LIBREOFFICE
OPENOFFICE
CALLIGRA
GOOGLE_DOCS
MS_OFFICE
KOFFICE
ABIWORD
OTHER

Result of generator suite detection.

Fields
string rawGenerator
string version_
string majorVersion
Methods
bool isUnknown() const @safe pure nothrowReturns `true` when the generator could not be identified.

Functions 11

fnOdfVersion parseOdfVersion(string versionString) @safe pure nothrowParses a version string (e.g. `"1.2"`) into an `OdfVersion` enum.
fnstring odfVersionString(OdfVersion ver) @safe pure nothrowConverts an `OdfVersion` to its string representation.
fnbool isSupportedVersion(OdfVersion ver) @safe pure nothrowReturns `true` if the given version is supported for reading and preservation. ODF 1.0 through 1.4 are all supported for safe reading and round-tripping.
fnbool isFullyTypedVersion(OdfVersion ver) @safe pure nothrowReturns `true` if the given version has full typed support.
fnOdfGeneratorInfo detectGenerator(string generator) @safe pure nothrowDetects the generator suite from a `meta:generator` string.
fnstring generatorQuirks(OdfGeneratorSuite suite) @safe pure nothrowReturns known namespace quirks for a given generator suite.
fnstring recommendedWriteVersion( OdfCompatibilityTarget target, OdfDocumentType docType) @safe pure nothrowChecks whether a given ODF version is appropriate for writing based on the compatibility target.
fnOdfCompatResult checkVersionCompatibility(string versionString, string generator, OdfCompatibilityTarget target, ref OdfDiagnosticCollector collector) @safe pureChecks an ODF document version against the compatibility target and reports findings through the diagnostic collector.
fnbool startsWith(string s, string prefix) @safe pure nothrow
fnptrdiff_t indexOf(string s, char c) @safe pure nothrow
fnbool canFind(string s, string needle) @safe pure nothrow