errorsyntaxxsd

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

Fix: Invoice Navigator can automatically reorder elements to match the UBL 2.1 schema sequence. Upload your invoice to fix this automatically.

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 rejected by Peppol access points and never reaches the buyer.

Target path: __from_error_message__

Why This Error Matters

cvc-complex-type.2.2 is a hard failure — the invoice must be corrected and re-sent before it can reach the recipient.

Invoices with elements in the wrong order are rejected by schema-validating systems. The data may be correct, but the structure prevents automated processing.

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

Frequently Asked Questions

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.

Invoice Navigator can automatically reorder elements to match the UBL 2.1 schema sequence. You can also use Invoice Navigator's compliance engine to correct this automatically in your pipeline.

Yes, cvc-complex-type.2.2 is a critical error that will cause invoice rejection. It must be fixed before submission.

Many instances of cvc-complex-type.2.2 can be automatically corrected using Invoice Navigator's compliance engine. The fix is applied in your pipeline with full audit evidence.

cvc-complex-type.2.2 is commonly seen in exports from Invoicing software with incorrect element ordering, Custom-built invoice generators, ERP systems generating non-compliant XML. These packages sometimes generate invoices that need adjustment.

Related Errors

Related Content

Last updated: 12 March 2026

Share this guide:

Validate your invoice

Drop your XML here to check for cvc-complex-type.2.2

Auto-fix cvc-complex-type.2.2 in seconds

Upload your invoice and we fix this error automatically. Financial fields are never touched.