Cargo feature flags
ooxmlsdk uses Cargo features to control optional API surface.
This page is about Rust crate features. The upstream SDK feature-collection extension model does not have a direct equivalent in ooxmlsdk.
Cargo features are compile-time switches. They choose which optional modules and dependencies are built into your binary; they are not per-package state, event hooks, or service registrations.
Default features
Most users can use the crate with its default features:
[dependencies]
ooxmlsdk = "0.10.2"
The default feature set enables parts, which provides package-level read/write APIs such as:
ooxmlsdk::parts::wordprocessing_document::WordprocessingDocumentooxmlsdk::parts::spreadsheet_document::SpreadsheetDocumentooxmlsdk::parts::presentation_document::PresentationDocument
parts
Enable parts when you want package APIs but want to disable other default behavior explicitly:
[dependencies]
ooxmlsdk = { version = "0.10.2", default-features = false, features = ["parts"] }
This is the minimum feature for reading and writing .docx, .xlsx, and .pptx packages through the strongly typed package model.
flat-opc
Enable flat-opc when you need Flat OPC XML package representations:
[dependencies]
ooxmlsdk = { version = "0.10.2", default-features = false, features = ["flat-opc"] }
This feature also enables parts.
mce
Enable mce when you want Markup Compatibility and Extensibility processing during package open and root loading:
[dependencies]
ooxmlsdk = { version = "0.10.2", default-features = false, features = ["mce"] }
This feature also enables parts.
validators
The validators feature exposes optional validation APIs:
[dependencies]
ooxmlsdk = { version = "0.10.2", features = ["validators"] }
Validation support is opt-in so projects that only need package parsing, modification, and round-tripping do not need to compile validator dependencies. With validators enabled, generated schema roots implement SdkValidator, and package types such as WordprocessingDocument can validate loaded root elements and return ValidationErrorInfo diagnostics.
Not yet modeled
The upstream runtime feature collection includes behaviors such as package events, part events, disposal callbacks, random-number services, and automatic paragraph ID generation. Those are not exposed as ooxmlsdk APIs. When porting examples that depend on those services, write the state management explicitly in Rust or leave the page unchanged until a tested crate API exists.