errorxsd

cvc-complex-type.2.2:Invoice XML elements are in the wrong order

The elements in your invoice XML are in the wrong order. UBL 2.1 and CII D16B schemas use strict element ordering (xs:sequence), which means child elements must appear in a specific order. Even if all the right elements are present with correct values, having them in the wrong order causes a schema validation failure.

Severity
Fatal
Rule set
xsd
Country
All EU
Fix type
AUTO-FIX
Confidence
85%
Category
structural

Engine Classification

Reorder child elements of the affected parent to match the UBL 2.1 schema sequence definition

Confidence: 85% · Applied automatically in pipeline

What is cvc-complex-type.2.2?

cvc-complex-type.2.2 is a fatal validation rule defined in the xsd specification. It validates the __from_error_message__ element in the UBL invoice XML.

When this rule fires, the invoice is non-compliant and will be rejected by Peppol access points and national validation services. The sending system receives a rejection response and the invoice does not reach the buyer.

Target path: __from_error_message__

Why This Error Matters

cvc-complex-type.2.2 is a hard failure. Invoices that trigger this rule are rejected at the access point and never reach the recipient. In Peppol networks, this means your sending system receives an MLR (Message Level Response) with a rejection status. The invoice must be corrected and re-sent, adding delay to your payment cycle.

Invoice Navigator can automatically correct this error in your pipeline. The fix is applied with full audit evidence, so your compliance trail remains intact.

Validator Behavior

  • ·Causes invoice rejection
  • ·Error returned: cvc-complex-type.2.2
  • ·Specification: xsd

How to Fix It

1.

Understand the issue

The error means elements are present but in the wrong order. The data itself is likely correct — only the ordering in the XML file needs to change.

2.

Try automatic reordering

Invoice Navigator's fixer can automatically reorder elements to match the UBL schema. Upload your invoice and apply the fix.

3.

Check your software

If this happens consistently, your invoicing software is generating elements out of order. Report this to your vendor — it's a straightforward fix on their end.

4.

Manual fix

If fixing manually, refer to the UBL 2.1 Invoice schema for the correct element sequence.

XML Example

Generic example based on the rule's target XPath. Your actual XML structure may differ.

Before
<!-- Triggers validation error -->
<__from_error_message__></__from_error_message__>
After
<!-- Corrected -->
<__from_error_message__>VALID_VALUE</__from_error_message__>

Technical Reference

XPath__from_error_message__
Specxsd
Operationreorder_elements
StrategyReorder child elements of the affected parent to match the UBL 2.1 schema sequence definition

Common Causes

  • ·cbc:IssueDate placed before cbc:ID (ID must come first)
  • ·cac:InvoiceLine elements mixed with header elements
  • ·UK software generating elements out of UBL sequence order
  • ·Manual XML editing breaking element order
  • ·ERP export template with elements in wrong sequence

Seeing this in production? The API handles cvc-complex-type.2.2 automatically. See the fix response →

Commonly Seen In

Invoicing software with incorrect element orderingCustom-built invoice generatorsERP systems generating non-compliant XML

Related Errors

Last updated: 12 March 2026

Share this guide:

Handle cvc-complex-type.2.2 Automatically in Your Pipeline

The compliance engine auto-remediates this error with controlled safety policies and evidence pack generation.