E-invoice error explained

XML is not valid against the schema

The file is not built the way the format prescribes.

What the rule checks

The file is not built the way the format prescribes. This concerns element names, namespaces, order and data types. The content is checked afterwards. The message usually names the line, column and element where the parser failed.

Official rule text

Summary in our own words, not an official rule text: The XML file must be valid against the XML schema (XSD) of its syntax. For XRechnung in CII this is UN/CEFACT Cross Industry Invoice D16B, for ZUGFeRD and Factur-X the schema of the profile in use (for example EN 16931 or EXTENDED), for XRechnung in UBL the OASIS UBL 2.1 Invoice or CreditNote schema. Only a schema-valid file goes on to the business rule checks (Schematron).

Summary of the requirement in our own words.

Typical causes

  • Elements are in the wrong order, for example ram:CityName before ram:PostcodeCode.
  • Date in the wrong format: with format="102" it must be YYYYMMDD, so 20260929, not 2026-09-29.
  • Amounts with a comma instead of a point, or with a thousands separator, for example 1.000,00.
  • An element is not allowed in the chosen ZUGFeRD profile, or a namespace is missing or wrong.

How to fix it

Go to the line and element named in the message. Check order, spelling and namespace against the schema. Write amounts with a point and no thousands separator, dates as YYYYMMDD. If the file was edited by hand or by a script, generate it again from the system.

Example

Wrong (CII)

<ram:IssueDateTime>
  <udt:DateTimeString format="102">2026-09-29</udt:DateTimeString>
</ram:IssueDateTime>
<!-- ... -->
<ram:PostalTradeAddress>
  <ram:CityName>Würzburg</ram:CityName>
  <ram:PostcodeCode>97070</ram:PostcodeCode>
</ram:PostalTradeAddress>

Right (CII)

<ram:IssueDateTime>
  <udt:DateTimeString format="102">20260929</udt:DateTimeString>
</ram:IssueDateTime>
<!-- ... -->
<ram:PostalTradeAddress>
  <ram:PostcodeCode>97070</ram:PostcodeCode>
  <ram:CityName>Würzburg</ram:CityName>
</ram:PostalTradeAddress>

In Dynamics 365, Business Central and Finance

Sales / Project Operations: Sales and Project Operations have no e-invoice output out of the box. In the WBS Invoice Accelerator for Dynamics 365 the Accelerator builds the CII file itself. A schema error should not occur there. Send the file and the message to WBS.

Finance: The file comes from the ER format configurations Sales Invoice DE and Project Invoice DE. If they were customised, compare your version with Microsoft's.

Related error codes

Check your invoice for free. The validator shows every finding with an explanation and its location in the XML.