XSD+SCH Erhvervsstyrelsen (Danish Business Authority), NemHandel · OIOUBL 2.1, Schematron 1.17.2

Denmark OIOUBL 2.1 Invoice

Danish e-invoice (OIOUBL 2.1 Invoice)

A Danish OIOUBL 2.1 invoice, checked against the UBL 2.1 schema and the OIOUBL Schematron of NemHandel.

About

OIOUBL is the Danish adaptation of UBL, sent through NemHandel, the Danish infrastructure for e-invoicing; nearly every invoice to the Danish public sector arrives as an e-invoice. Its CustomizationID is OIOUBL-2.1. Peppol BIS Billing 3.0, the other format Danish systems handle, has Danish rules (DK-R-*) of its own.

The OIOUBL rules check the profile, parties and their identifiers (CVR, EAN), tax totals and line amounts, code lists and the structure OIOUBL allows. They name themselves in their messages: F- rules are errors, W- rules warnings.

E-invoicing in Denmark: the rules in short and how to check an invoice →

Good to know

  • Rules run only when the document matches the schema. Documents over 50 MB are checked against the schema only.
  • The rules are NemHandel's OIOUBL Schematron 1.17.2 (May 2026). They carry some XSLT of their own, which we turn into Schematron of the same meaning before they are compiled (two variables, two checks that write OIOUBL's own error report); the rule ids and levels are the ones their messages name.
  • The example is from the test files of the OIOUBL Schematron package, as phive-rules keeps them.

Files

14 files · 2.7 MB · Download all (.zip)
  • maindoc/UBL-Invoice-2.1.xsd main
    58.8 KB View Download
  • common/UBL-CommonAggregateComponents-2.1.xsd
    2.3 MB View Download
  • common/UBL-CommonBasicComponents-2.1.xsd
    214.7 KB View Download
  • common/UBL-CommonExtensionComponents-2.1.xsd
    9.3 KB View Download
  • common/UBL-QualifiedDataTypes-2.1.xsd
    3.5 KB View Download
  • common/UBL-UnqualifiedDataTypes-2.1.xsd
    26.7 KB View Download
  • common/UBL-ExtensionContentDataType-2.1.xsd
    4.2 KB View Download
  • common/CCTS_CCT_SchemaModule-2.1.xsd
    44.2 KB View Download
  • common/UBL-CommonSignatureComponents-2.1.xsd
    5.4 KB View Download
  • common/UBL-SignatureAggregateComponents-2.1.xsd
    7.6 KB View Download
  • common/UBL-SignatureBasicComponents-2.1.xsd
    4.1 KB View Download
  • common/UBL-xmldsig-core-schema-2.1.xsd
    10.5 KB View Download
  • common/UBL-XAdESv132-2.1.xsd
    21.2 KB View Download
  • common/UBL-XAdESv141-2.1.xsd
    1.3 KB View Download

The validator loads all of these with their folder structure, so includes and imports resolve as published.

Business rules

Schematron · run in this order

The rules run after the schema check, only when the document matches the schema, and in your browser like the schema check (with SaxonJS by Saxonica). Each finding names its rule, such as BR-CO-15, and the line it points at; each rule has a page with what it checks.

Example document

dk-oioubl-invoice.xml · 9.5 KB · passes the schema and the rules

In CI and from code

The same schema by its name, dk-oioubl-invoice, through the API.

npx @xmlvalid/cli validate "**/*.xml" --schema dk-oioubl-invoice
- uses: xmlvalid/validate-action@v1
  with:
    files: "**/*.xml"
    schema: dk-oioubl-invoice
    api-key: ${{ secrets.XMLVALID_API_KEY }}
curl https://xmlvalid.com/api/v1/validations \
  -H "Authorization: Bearer $XMLVALID_API_KEY" \
  -F document=@dk-oioubl-invoice.xml \
  -F schema=dk-oioubl-invoice

Free accounts get 100 API validations a month. On Pro, a URL monitor can check a published document against this schema every hour and email you when it breaks. More CI setups