Architecture
Layers
- Lossless tree core —
Document,Element,Attribute, andNodepreserve XML information rather than projecting a reduced DTO. - Generated declaration model — committed catalog metadata drives skeleton creation, ordering, cardinality, choices, labels, and structural diagnostics.
- Canonical interfaces — the
openbim-idmcrate owns the Rust API,idmxmlRust binary, and PyO3_nativemodule. - Thin Python ergonomics —
python/idmxmladds path I/O, dictionaries, optionallxmlvalidation, andidmpyargument parsing. - Compatibility alias — the
idmxmlCargo package re-exports canonical symbols at an exact version and has no behavior.
Trust boundaries
XML bytes and externally supplied schemas are untrusted input. Rust parsing applies input/depth limits and rejects DOCTYPE; Python formal validation disables entities, DTDs, and network access. The schema directory is an explicit consumer-controlled trust input, constrained to a six-filename include graph.
Standards boundary
The source schemas are generation/validation inputs, not distributable runtime assets. Runtime structural behavior is based on the generated metadata snapshot and documented overlays. Formal XSD conformance is a separate optional operation requiring user-supplied files.
Invariants
- One canonical Rust type universe.
- Unknown XML data survives edits.
- No standards payload in source or generated web/package artifacts.
- No silent network fallback.
- Publication stays blocked until provenance and rights gates change together.
See Canonical and alias crates for the enforced dependency boundary.