Schematron for e-invoices: what it is, which rules apply, reading a failure

What a schematron is, which official rule sets check which e-invoice (EN 16931, Factur-X, BR-FR, Peppol, XRechnung), and how to read a failure and fix it.

  • Updated 26 November 2026
  • 17 min read
  • In English, French and German

In short

Schematron is an ISO standard, ISO/IEC 19757-3, for writing rules about the content of an XML document. Each rule points at a place in the file with an XPath expression, states a test, and carries the message to show when the test fails. The bodies behind the e-invoice standards publish their business rules this way: CEN for EN 16931, FNFE-MPE and FeRD for Factur-X and ZUGFeRD, OpenPeppol for Peppol BIS, KoSIT for XRechnung, and FNFE-MPE again for the French reform (BR-FR and EXTENDED-CTC-FR).

An e-invoice is checked in two steps. First the XML schema (XSD) of its syntax, UBL or CII, checks its structure. Then the schematron rules of the specification it declares in its specification identifier (BT-24) check its content: totals that add up, fields that must be there, codes from the right list. The rules answer with an SVRL report, in which each failure has a rule code, a level (fatal or warning), a location written as an XPath and a message.

This guide explains what a schematron is made of, which rule sets apply to which invoice, why UBL and CII each have their own files, how to read a failure and how to run the rules yourself. To check an invoice now: open the validator.

What a schematron is: the definition

Schematron is a language for rules on XML documents, defined in part 3 of the ISO/IEC 19757 standard; its fourth edition came out in 2025. A schematron is itself an XML file. An XML schema says which elements a document may contain, in which order and with which data type. A schematron adds what a schema cannot say: if this element is there, that one must be too; this amount must equal that sum; this code must be in that list.

A schematron is built from a few elements. The examples come from PEPPOL-EN16931-UBL.sch, the Peppol BIS rules for UBL:

ElementWhat it doesExample in the Peppol rules
schemaThe root of the file; its queryBinding names the language of the testsqueryBinding="xslt2": tests in XPath 2.0, run as XSLT 2.0
nsDeclares a namespace prefix that the rules usecbc for the UBL basic components
letA variable computed from the invoiceThe seller's country, taken from its VAT number or its address
patternA group of rulesOne pattern holds a single rule: no element may be empty (PEPPOL-EN16931-R008)
ruleIts context is an XPath: the rule runs on every element it matchescontext="cbc:TaxCurrencyCode"
assertA test in XPath that must be true, with an id, a flag and the message shown when the test is falsePEPPOL-EN16931-R005, flagged fatal: the VAT accounting currency must differ from the invoice currency
reportThe reverse: its message is shown when its test is trueNot used by Peppol; the Factur-X rules use it, for example for an attribute their profile does not use

A schematron is rarely run as it is. It is usually compiled into an XSLT stylesheet, and the stylesheet is run on the invoice with an XSLT 2.0 processor such as Saxon. CEN, FNFE-MPE (for Factur-X and for the French reform) and KoSIT also ship their rules compiled to XSLT; OpenPeppol ships the schematron files only.

The result is an SVRL report, the XML report format defined in the same ISO standard. Each time a rule applies to an element, the report notes a svrl:fired-rule. Each test that failed leaves a svrl:failed-assert with the rule's id, its flag, the location of the element and the message in svrl:text; a report whose test was true leaves a svrl:successful-report. An SVRL report with neither of the last two found nothing.

First the schema, then the rules

The XML schema (XSD) comes first. It checks that the file is an invoice of its syntax at all: the right root element, known element names in the allowed order, values of the right type, such as a number for an amount. For UBL it is the UBL 2.1 schema (one for invoices, one for credit notes); for CII, the UN/CEFACT CII schema; for a Factur-X invoice, the schema of its profile, which leaves out what the profile does not use.

The schematron rules come second, because a schema does not know what an invoice means. An invoice whose total with VAT is 7 cents off still passes the UBL 2.1 schema, and so does an invoice line with an empty identifier. EN 16931 forbids both (rules BR-CO-15 and BR-21), and only its schematron checks them. The order matters too: rules run on a file that breaks its schema say little worth reading, so a validator runs them only once the schema passes.

The schematron rule sets for e-invoices

Each publisher maintains its own rule set, as schematron files and, for most of them, as compiled XSLT. These are the sets for European e-invoices, in the versions this site runs:

Rule setVersionPublisherSyntaxFor which invoices
EN 169311.3.16CEN/TC 434UBL and CIIEvery invoice under the European standard; the base of all the others
Factur-X / ZUGFeRD1.09.2 (= ZUGFeRD 2.5.2)FNFE-MPE and FeRDCIIFactur-X and ZUGFeRD invoices, one file per profile: MINIMUM, BASIC WL, BASIC, EN 16931, EXTENDED
EXTENDED-CTC-FR1.4.0.04FNFE-MPEUBL and CIIInvoices of the French reform that need more than EN 16931
BR-FR1.4.0.04FNFE-MPEUBL and CIIInvoices of the French reform, on top of the rules of their profile
Peppol BIS Billing 3.03.0.21OpenPeppolUBLInvoices sent over the Peppol network, Belgian ones among them; with the CEN rules
XRechnung3.0.2 (rules 2.6.0)KoSITUBL and CIIInvoices to German public buyers; with the CEN rules

CEN published version 1.3.17 of the EN 16931 rules on 12 October 2026; the latest releases of KoSIT, FNFE-MPE and Peppol still build on 1.3.16. The Factur-X files mix the EN 16931 rules a profile needs with rules of their own (FX-SCH-A-…) on which elements the profile allows and how often. MINIMUM and BASIC WL carry less than a full EN 16931 invoice: MINIMUM holds the header and footer data, BASIC WL has no lines.

For France, FNFE-MPE describes the check in two parts: the profile (its XSD and its schematron) and the French management rules (the BR-FR schematron). The BR-FR file comes in a standard version, where every rule is fatal, and a "warning" version that lets every invoice through for the first exchanges. The standard version applies to sending since 1 September 2026, and to receiving from 1 September and by 1 October 2026 at the latest. E-reporting (Flux 10) has rules of its own, which FNFE-MPE publishes as a separate schematron; they are not invoice rules and are not covered here.

Which rule set applies to which invoice

The specification identifier (BT-24) chooses the rules: cbc:CustomizationID in UBL, ram:GuidelineSpecifiedDocumentContextParameter/ram:ID under rsm:ExchangedDocumentContext in CII. The table gives the identifiers the publishers check and the rules this site's validator runs for each, in this order:

Specification identifier (BT-24)SyntaxRules, in order
urn:factur-x.eu:1p0:minimumCIIFactur-X MINIMUM
urn:factur-x.eu:1p0:basicwlCIIFactur-X BASIC WL
urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basicCIIFactur-X BASIC
urn:cen.eu:en16931:2017UBL or CIIEN 16931 (CEN); Factur-X EN 16931 for the XML of a Factur-X PDF
urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extendedCIIFactur-X EXTENDED
urn:cen.eu:en16931:2017#conformant#urn.cpro.gouv.fr:1p0:extended-ctc-frUBL or CIIEXTENDED-CTC-FR
Starts with urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0UBLEN 16931 (CEN), then Peppol BIS
urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0UBL or CIIEN 16931 (CEN), then XRechnung
None, or one not listed hereUBL or CIIEN 16931 (CEN)

Each Factur-X identifier has a ZUGFeRD twin, with urn:zugferd.de:2p0: in place of urn:factur-x.eu:1p0:, which selects the same rules. The XRechnung identifier also counts when it is followed by the extension (#conformant#urn:xeinkauf.de:kosit:extension:xrechnung_3.0) or the clean-vehicles variant (#compliant#urn:xeinkauf.de:kosit:xrechnung:cvd_0.9). The Factur-X and EXTENDED-CTC-FR files contain the EN 16931 rules they need and run alone; Peppol and XRechnung add their rules to the CEN ones, which run first, as their publishers do.

A Factur-X EN 16931 invoice carries the identifier of the standard itself, so its XML alone cannot say it is Factur-X: only the PDF it came from does. So this site checks the XML of a Factur-X EN 16931 PDF with the Factur-X EN 16931 rules, and the same XML on its own with the CEN rules. The rules of a country come on top, whatever the profile: for France, the BR-FR file of the invoice's syntax; for Germany, for information, the XRechnung rules on an invoice that is not already an XRechnung.

Schematron for UBL and for CII

EN 16931 defines one set of business rules, but UBL and CII put each field in a different place. A rule is an XPath, so each syntax needs its own file: CEN publishes EN16931-UBL-validation and EN16931-CII-validation, KoSIT and FNFE-MPE do the same. Here is rule BR-21, "each invoice line has a line identifier", in the two CEN files:

Part of the ruleUBLCII
Contextcac:InvoiceLine, or cac:CreditNoteLine in a credit note//ram:IncludedSupplyChainTradeLineItem
Testnormalize-space(cbc:ID) != ''normalize-space(ram:AssociatedDocumentLineDocument/ram:LineID) != ''
Flagfatalfatal
Message[BR-21]-Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).The same

The code, the level and the message are the same; only the paths change. A few rules exist in one syntax only, because they are about the syntax itself: UBL-CR-…, UBL-SR-… and CII-SR-…. Most of them are warnings about elements of UBL or CII that EN 16931 does not use. A converted invoice is checked with the file of its new syntax. Where each field sits in both syntaxes is in the field mapping.

Reading a schematron failure

Each failure in an SVRL report has the same parts. The example is real: a UBL invoice whose first line has an empty identifier, run through the CEN rules 1.3.16.

PartIn the SVRLIn the example
The ruleidBR-21
The levelflagfatal
The placelocation/Invoice[1]/InvoiceLine[1], written in the report with every namespace in full
What was testedtestnormalize-space(cbc:ID) != ''
The messagesvrl:text[BR-21]-Each Invoice line (BG-25) shall have an Invoice line identifier (BT-126).

The level

The standard leaves the values of flag to the authors of the rules. The e-invoice rule sets use fatal for a rule the invoice must meet and warning for a recommendation; the XRechnung rules also have an information, and the Factur-X files leave the flag out of their errors. A fatal failure means the invoice does not meet the specification; an invoice can meet it with warnings left.

The place

The location is an XPath to the element the rule was checked on. [2] means the second element of that name: in a CII invoice, /CrossIndustryInvoice[1]/SupplyChainTradeTransaction[1]/IncludedSupplyChainTradeLineItem[2] is the second line. A rule on the invoice as a whole points at the root, and the BT numbers in the message say which fields are involved: BR-CO-15 names BT-112, BT-109 and BT-110.

The code and the language

The code tells which rule set the failure comes from:

Code starts withRule set
BR- and a number, BR-CO-, BR-CL-, BR-DEC-, and one family per VAT category, such as BR-S-EN 16931, also repeated in the Factur-X and EXTENDED-CTC-FR files
UBL-CR-, UBL-SR-, UBL-DT-, CII-SR-, CII-DT-EN 16931, rules of the syntax
FX-SCH-A-Factur-X, the elements a profile allows
BR-FREXT-, BR-FXEXT-EXTENDED-CTC-FR
BR-FR-French reform (BR-FR)
PEPPOL-EN16931-, PEPPOL-COMMON-, and country rules such as DK-R- or NL-R-Peppol BIS; XRechnung reuses some PEPPOL-EN16931- rules
BR-DE-, BR-DEX-, BR-TMP-XRechnung

Each message is in the language its publisher wrote it in: German for the XRechnung rules (BR-DE), French for the rules of the French reform (BR-FR and BR-FREXT), English for the others. Many BR-FR messages also quote the value they found.

What "schematron validation failed" means

When a tool says "schematron validation failed", the invoice was checked against a set of schematron rules and at least one rule of error level failed. The short message does not say which rule: that is in the list of failures. To fix it:

  1. Get the list of failures. Ask the tool or the platform for the full report, or check the file in a validator that shows each rule.
  2. Start with the fatal failures. They are the ones that make the check fail; the warnings can wait.
  3. Check the specification identifier (BT-24). It chooses the rules. If the receiver checks the invoice against other rules than the ones it declares, the identifier is among the failures: PEPPOL-EN16931-R004 under the Peppol rules (fatal), BR-DE-21 under the XRechnung rules (a warning).
  4. Go to the location and read the test. The XPath leads to the element, the BT numbers name the fields, and the test says exactly what was checked.
  5. Fix the source, then check again. Correct the data or the setting in the software that produced the invoice, not only the XML, then check the new file.
  6. Compare the versions. If two validators disagree, compare the versions of the rules they run: CEN alone has released four versions of the EN 16931 rules since June 2025.

Three frequent failures, explained

These three rules are not national ones, and they come up often in the reports of this site's validator. Each heading is the rule's code, so a finding in the validator links straight to its explanation.

PEPPOL-EN16931-R010: Buyer electronic address

The invoice must give the buyer's electronic address (BT-49). Level: error. The rule comes from Peppol BIS Billing 3.0, and XRechnung 3.0 kept it, so it runs on every Peppol invoice, and on every XRechnung in UBL or CII. EN 16931 itself leaves the field optional.

[PEPPOL-EN16931-R010]-Buyer electronic address MUST be provided

The electronic address is where the buyer receives its e-invoices: a Peppol identifier, an e-mail address or, for a German public buyer, its Leitweg-ID. It always comes with a scheme from the EAS code list, which BR-63 requires: 0088 for a GLN, 0204 for a Leitweg-ID, 9930 for a German VAT number, 0225 for an address of the French reform, EM for an e-mail address. The seller's address (BT-34) has the same rule, PEPPOL-EN16931-R020.

Usual cause: the software fills in the seller's electronic address but not the buyer's, or keeps the buyer's e-mail address only in the contact (BT-58). Fix: ask the buyer which address to use. In UBL, write it as cbc:EndpointID at the start of cac:AccountingCustomerParty/cac:Party, before cac:PartyIdentification. In CII, write it as ram:URIUniversalCommunication/ram:URIID in ram:BuyerTradeParty, after the postal address:

<ram:URIUniversalCommunication>
  <ram:URIID schemeID="EM">invoices@buyer.example</ram:URIID>
</ram:URIUniversalCommunication>

UBL-SR-16: One buyer identifier

A UBL invoice may give only one buyer identifier (BT-46). Level: error. The rule is one of the UBL syntax rules of EN 16931, so it runs on every UBL invoice checked against them, Peppol and XRechnung invoices included. The EXTENDED-CTC-FR rules of the French reform do not contain it.

[UBL-SR-16]-Buyer identifier shall occur maximum once

The rule counts the cac:PartyIdentification/cbc:ID of cac:AccountingCustomerParty/cac:Party. The seller may have several identifiers (BT-29), the buyer only one, so software that writes the same list for both parties fails on the buyer only.

Usual cause: the software writes every number it knows about the buyer as an identifier: a customer number, a GLN, the SIREN or SIRET, the VAT number. Fix: keep one cac:PartyIdentification, with the identifier the buyer is known by and its scheme if it has one. The legal registration number (BT-47), such as a SIREN with scheme 0002, goes in cac:PartyLegalEntity/cbc:CompanyID; the VAT number (BT-48) goes in cac:PartyTaxScheme/cbc:CompanyID:

<cac:AccountingCustomerParty>
  <cac:Party>
    <cac:PartyIdentification>
      <cbc:ID schemeID="0088">5790000435968</cbc:ID>
    </cac:PartyIdentification>
    <!-- name and postal address -->
    <cac:PartyTaxScheme>
      <cbc:CompanyID>FR32123456789</cbc:CompanyID>
      <cac:TaxScheme><cbc:ID>VAT</cbc:ID></cac:TaxScheme>
    </cac:PartyTaxScheme>
    <cac:PartyLegalEntity>
      <cbc:RegistrationName>Buyer SAS</cbc:RegistrationName>
      <cbc:CompanyID schemeID="0002">123456789</cbc:CompanyID>
    </cac:PartyLegalEntity>
  </cac:Party>
</cac:AccountingCustomerParty>

BR-CL-22: VAT exemption reason code

The VAT exemption reason code (BT-121) must come from the VATEX code list. Level: error. The rule belongs to EN 16931, in UBL and in CII, and the EXTENDED-CTC-FR rules repeat it. Despite its wording, it checks the code itself, not a scheme identifier.

[BR-CL-22]-Tax exemption reason code identifier scheme identifier MUST belong to the CEF VATEX code list

The CEN rules 1.3.16 accept 88 codes: 62 European ones (VATEX-EU-…) and 26 French ones (VATEX-FR-…). The code must be one word; upper or lower case does not matter. The rule checks every cbc:TaxExemptionReasonCode in UBL and every ram:ExemptionReasonCode in CII.

Usual cause: the field holds the reason in words, which belongs in the exemption reason text (BT-120), a VAT category code such as AE instead of VATEX-EU-AE, or a code of the software's own. Fix: write the VATEX code that goes with the VAT category (BT-118), and the reason in words in BT-120 if you want one:

VAT category (BT-118)Usual VATEX code
AE, reverse chargeVATEX-EU-AE
K, intra-community supplyVATEX-EU-IC
G, export outside the EUVATEX-EU-G
O, not subject to VATVATEX-EU-O
E, French small business scheme (franchise en base)VATEX-FR-FRANCHISE

There is no German VATEX code for the small business scheme of § 19 UStG. For category E, BR-E-10 accepts the reason text alone, so leave the code out and write the reason in BT-120. In UBL the code sits in cac:TaxCategory, between cbc:Percent and cbc:TaxExemptionReason; in CII, in ram:ApplicableTradeTax, right after ram:CategoryCode:

<ram:ApplicableTradeTax>
  <ram:CalculatedAmount>0.00</ram:CalculatedAmount>
  <ram:TypeCode>VAT</ram:TypeCode>
  <ram:ExemptionReason>Reverse charge</ram:ExemptionReason>
  <ram:BasisAmount>1000.00</ram:BasisAmount>
  <ram:CategoryCode>AE</ram:CategoryCode>
  <ram:ExemptionReasonCode>VATEX-EU-AE</ram:ExemptionReasonCode>
  <ram:RateApplicablePercent>0</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>

Running the schematron rules yourself

You need the compiled XSLT of the rule set, the invoice and an XSLT 2.0 processor. Saxon-HE, the free edition of Saxon, runs from the command line with Java; version 12 also needs the XML Resolver library next to it. For the EN 16931 rules on a UBL invoice, take EN16931-UBL-validation.xslt from the CEN release and run java -cp Saxon-HE-12.10.jar:xmlresolver-5.3.3.jar net.sf.saxon.Transform -s:invoice.xml -xsl:EN16931-UBL-validation.xslt -o:report.xml (on Windows, separate the two jars with ;).

The command does not say whether the invoice passed: it writes the SVRL report to report.xml, and the failures are the svrl:failed-assert elements in it. Before you rely on it:

  • Check the schema first. Run the XSD of the syntax or the profile before the rules, as a validator does.
  • Run the CEN rules too for Peppol and XRechnung. Their files hold only their own rules; OpenPeppol lists the CEN schematron next to its own.
  • Compile the Peppol rules first. OpenPeppol ships .sch files only: compile them to XSLT, for example with SchXslt on Saxon (this site used SchXslt 1.10.1 and its pipeline-for-svrl.xsl for XSLT 2.0), then run the result as above.
  • Keep the Factur-X files together. Each Factur-X XSLT reads a code list file from its own folder.

Where this site fits

The validator is an online schematron validator for e-invoices. It runs the official files listed above, unchanged, on Saxon-HE: the XSLT their publishers compiled, and for Peppol the XSLT compiled here from the OpenPeppol schematron.

  • Schema first. It checks the invoice against the schema of its syntax and profile, and runs the rules only if the schema passes.
  • The rules of the declared profile, chosen from BT-24 as in the table above. A Factur-X or ZUGFeRD PDF is accepted: its XML is taken out first.
  • The rules of a country, on request. France adds the BR-FR rules; Germany adds, for information, the XRechnung rules.
  • Each finding gives the rule's code, its level (error, warning or information), its message as the publisher wrote it, and the place as a short XPath such as /Invoice[1]/InvoiceLine[1]. Each rule set lists its first 200 findings and counts the rest.
  • What it does not do. It does not take a schematron of your own, does not run the e-reporting rules, does not give the SVRL file, and cannot know whether a SIREN or a VAT number really exists.

The French rules have guides of their own: the BR-FR rules, the EXTENDED-CTC-FR profile and the AFNOR standard XP Z12-012 behind them. The XRechnung rules are explained in the guide to the BR-DE rules, with the Leitweg-ID.

Sources

Last updated: 26 November 2026 · Written by CTC Engine. How the guides are written

Did this guide help you?

The guides are free and follow each new version of the rules. A small thank-you helps keep them up to date.