Expand description
redispatch-xml — Redispatch 2.0 XML/XSD format parsing and validation
for the German electricity grid (§§ 13, 13a, 14 EnWG).
§Domain background
Redispatch 2.0 entered into force on 1 October 2021 via the Netzausbaubeschleunigungsgesetz (NABEG) and requires all German grid operators to coordinate congestion management across transmission and distribution networks. It covers:
- All renewable-energy (EE) and combined heat-and-power (KWK) plants with ≥ 100 kW installed capacity
- All installations permanently remote-controllable by a grid operator (e.g. via Smart-Meter-Gateway)
§Format family
Redispatch 2.0 uses CIM/IEC 62325-based XML documents for the primary data exchange between TSOs, DSOs, and balance responsible parties. Documents are validated against BDEW-published XSD schemas (topicGroupId 25 in the BDEW MaKo document API).
| Document type | XSD version | Latest revision |
|---|---|---|
ActivationDocument | 1.1f | Fehlerkorrektur 2026-02-19 |
PlannedResourceScheduleDocument | 1.0f | Fehlerkorrektur 2026-02-19 |
AcknowledgementDocument | 1.0g | 2025-10-01 |
Stammdaten | 1.4b | Fehlerkorrektur 2026-02-19 |
StatusRequest_MarketDocument | 1.1 | 2025-04-01 |
Unavailability_MarketDocument | 1.1b | Fehlerkorrektur 2025-04-16 |
Kaskade | 1.0 | Fehlerkorrektur 2026-02-19 |
NetworkConstraintDocument | 1.1b | 2025-04-01 |
Kostenblatt | 1.0d | Fehlerkorrektur 2025-04-16 |
These are not EDIFACT. IFTSTA status messages for the Redispatch 2.0
workflow are handled separately by the edi-energy crate.
§Validation is structural and semantic, never XSD
This crate ships no schema bytes and performs no XSD validation.
The BDEW XSDs are third-party copyrighted publications and are not
redistributable, so embedding them here would put someone else’s material in
every copy of this crate and make a clean build depend on a file that is not
part of it. A bundled-schemas Cargo feature once promised a
schema_bytes(DocumentType) accessor for exactly that; it was declared
empty, exported nothing, and has been removed — a feature flag that does
nothing reads as a supported configuration.
What replaces it is validation: the structural checks assert the
cardinalities and required elements the XSDs express, and the semantic
checks assert the rules the XSDs cannot express. Callers who must validate
against the published schema do so with their own copy and their own XSD
processor.
§Market roles
| Role | Abbrev. | Description |
|---|---|---|
| Übertragungsnetzbetreiber | ÜNB | Transmission system operator |
| Verteilnetzbetreiber | VNB | Distribution system operator |
| Anlagenbetreiber | ANB | Generation asset operator |
| Direktvermarkter | DV | Direct marketer of renewable energy |
| Bilanzkreisverantwortlicher | BKV | Balance responsible party |
§Quick start
use redispatch_xml::{parse, Document};
let xml: &[u8] = b"<ActivationDocument xmlns=\"urn:entsoe.eu:wgedi:errp:activationdocument:5:0\">...</ActivationDocument>";
match parse(xml) {
Ok(Document::Activation(doc)) => println!("Got ACO/ACR/AAR: {:?}", doc.document_type),
Ok(other) => println!("Other document type: {:?}", other.document_type()),
Err(e) => eprintln!("Parse error: {e}"),
}§Regulatory references
- §§ 13, 13a, 14 EnWG — statutory basis for grid congestion management
- NABEG 2019 — introduced Redispatch 2.0, effective 1 October 2021
- BNetzA BK6-20-059/060/061 — three BNetzA rulings governing billing balance, grid operator coordination, and information provision
- BDEW XML-Datenformate Redispatch 2.0 — XSD schemas and application guidelines published on bdew-mako.de
Re-exports§
pub use documents::AcknowledgementDocument;pub use documents::ActivationDocument;pub use documents::DocumentType;pub use documents::Kaskade;pub use documents::Kostenblatt;pub use documents::NetworkConstraintDocument;pub use documents::PlannedResourceScheduleDocument;pub use documents::Stammdaten;pub use documents::StatusRequestMarketDocument;pub use error::RedispatchXmlError;pub use validation::ValidationResult;pub use validation::ValidationWarning;pub use validation::validate;
Modules§
- documents
- Concrete document types for all nine Redispatch 2.0 document families.
- error
- Error types for Redispatch 2.0 XML.
- types
- Primitive types and value wrappers for Redispatch 2.0 XML.
- validation
- Structural and semantic validation for Redispatch 2.0 documents.
Enums§
- Document
- A parsed Redispatch 2.0 document (any of the nine supported types).
Functions§
- detect
- Detect the document type of a Redispatch 2.0 XML message without fully deserializing it.
- parse
- Deserialise a Redispatch 2.0 XML document into the appropriate
Documentvariant. - parse_
and_ validate - Parse a Redispatch 2.0 XML document and run structural + semantic validation in one step.
- parse_
as - Deserialise a Redispatch 2.0 XML document into a specific type
T. - serialize
- Serialise a
Documentto an XML byte vector. - serialize_
as - Serialise a specific document type
Tto an XML byte vector.