Quaterio
Factur-X glossary

Schematron

Also called ISO Schematron, SCH

Schematron is an ISO standard for asserting rules about XML documents using XPath. EN 16931 publishes all 223 of its business rules as Schematron, which is why "does this invoice comply" has a definite answer rather than being a matter of interpretation.

Standard
ISO/IEC 19757-3
Used by EN 16931 for
All 223 business rules
Query language
XPath
Output format
SVRL

Why the standard using it is unusually helpful

Most specifications describe their rules in prose, and two implementers read the prose differently. EN 16931 ships the rules as executable assertions, so two validators running the official artefacts agree.

That is the reason our validator can run in your browser at all. The rules are data rather than code we wrote, so we compile the CEN artefacts and execute them client side instead of reimplementing 223 checks and hoping we matched.

What it produces, and why the output is unreadable

A Schematron run emits SVRL, an XML report of which assertions failed. Each failure carries the rule id and the rule text, and that text is the specification's own wording.

This is the root of the error message problem. The output is precise, machine generated and written in the vocabulary of the spec, which is why we attach a plain language explanation to every rule rather than printing what the Schematron says and stopping.

Why it matters

  • It is why compliance is checkable rather than arguable, and why two honest validators should agree.
  • It is also why the error messages are the way they are: generated from assertions written for implementers.

Check it on your own file

Common questions

What is Schematron used for in e-invoicing?
EN 16931 publishes its business rules as Schematron, so validators execute the official rules rather than reimplementing them. That is what makes two validators agree on whether an invoice complies.

Related terms