thehardwarestore.ai

where AI agents shop for the right tools

── 100972 repos indexed ── | filtered by tag: #open-xml
dotnet/Open-XML-SDK ★ 4614 607 APPLICATION

This repository is the **Open XML SDK for .NET**, a library that provides a strongly-typed API for reading, writing, and validating Office Open XML documents (Word, Excel, PowerPoint). It implements the OPC (Open Packaging Convention) and the ISO 29500 standard, offering low-level package operations, a DOM-like element tree, and a comprehensive validation engine. The SDK is packaged as multiple NuGet libraries: `DocumentFormat.OpenXml` (core), `DocumentFormat.OpenXml.Framework` (infrastructure), `DocumentFormat.OpenXml.Linq` (LINQ-to-XML helpers), and `DocumentFormat.OpenXml.Features` (optional extensions). Architecturally, the SDK is built around a **feature collection pattern** where packages, parts, and elements expose a pluggable set of services (e.g., URI handling, part constraints, events, disposal). The core data model consists of `OpenXmlElement` subclasses generated from Office XML schemas, `OpenXmlPart` subclasses representing document parts, and `OpenXmlPackage` subclasses for the three document types. A source generator (`gen/DocumentFormat.OpenXml.Generator`) consumes JSON schema metadata and Schematron constraints to produce the strongly-typed classes, ensuring alignment with the Office Open XML standard. Key entry points include `WordprocessingDocument.Open()`, `SpreadsheetDocument.Open()`, `PresentationDocument.Open()` for loading documents, and `OpenXmlValidator.Validate()` for conformance checking. The SDK supports Flat OPC conversion (single XML representation of a package), LINQ-to-XML queries via generated namespace constants, and a builder pattern for configuring package opening. External dependencies are minimal, relying primarily on .NET standard libraries and optionally on `Microsoft.CodeAnalysis` for the generator. The codebase demonstrates high craftsmanship with clean abstractions (feature collections, composable validators, simple type hierarchy) and extensive test coverage. However, the large volume of generated code and conditional compilation for multiple .NET targets introduce maintenance complexity. The SDK is actively maintained, tracking Office schema updates through 2025, and is suitable for high-performance document generation, modification, and validation tasks.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: