XSD validation is necessary, but not sufficient.
XSD checks XML structure, element order and data types. It cannot by itself establish that references resolve, mappings are known, declared totals reconcile or transactions balance.
What XSD catches
- Missing required elements and incorrect ordering.
- Invalid dates, numbers and text formats.
- Values outside schema-defined constraints.
When XSD validation fails
Saftlint reports up to 50 deduplicated XSD errors with line and column where available. Content checks that require an XSD-valid file are marked as not run, never as passed.
What requires semantic checks
- References to absent accounts or counterparties.
- Unknown tax or account-grouping mappings.
- Declared totals that differ from transaction lines.
- Unbalanced transactions and inconsistent selection periods.
An XSD-valid reference violation
An Owner can contain <AccountID>2250</AccountID> even when account 2250 is absent from GeneralLedgerAccounts. The structure and type are valid, but the reference is broken. Saftlint reports master.owner.account.exists.
If you develop a SAF-T exporter, this type of defect can become a permanent regression fixture. See how software vendors can test Norwegian SAF-T.