errorstructurexsd

cvc-complex-type.2.1:Element declared as empty contains character or child content

Fix: Remove text, whitespace, and child nodes from the offending element, or route the data to the correct leaf if a real value was written into the wrong element.

cvc-complex-type.2.1 is an XSD schema-validation error raised by Xerces-based parsers when an element whose content type is declared as empty contains character data or child elements. The canonical message reads: "Element X must have no character or element information item [children], because the type's content type is empty."

Severity
Fatal
Rule set
xsd
Country
All EU
Fix type
CONFIRM
Confidence
55%

Engine Classification

Requires user confirmation before application

What is cvc-complex-type.2.1?

cvc-complex-type.2.1 is a fatal validation rule defined in the xsd specification.

When this rule fires, the invoice is rejected by Peppol access points and never reaches the buyer.

Why This Error Matters

XSD validation runs before Peppol Schematron, KoSIT checks, and every other validation layer. A schema-level failure here means the document never reaches business-rule validation and is blocked at the network edge.

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

Validator Behavior

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

Before / After

Failing XML
<cbc:AccountingCost>  </cbc:AccountingCost>
Corrected XML
<cbc:AccountingCost>COST-CTR-4100</cbc:AccountingCost>

Technical Reference

Specxsd

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

Frequently Asked Questions

An element whose XSD content type is declared empty has non-empty content in your document. The XSD parser enforces the empty contract and rejects the element.

2.1: element should be empty, has content. 2.3: element-only type has text. 2.4.a/b/d: specific element-order or presence violations.

Whitespace-only or comment-only content is safely stripped automatically. When real data has been written into the empty element the fix requires a mapping change and Invoice Navigator escalates it as blocked.

Local validators often tolerate whitespace inside empty-type elements. Peppol Access Points run strict Xerces validation against the canonical XSD, so lenient local passes can still fail 2.1 at the AP.

Yes. All three rely on the same XSD parser behaviour. The set of empty-type elements differs, but the validation error is schema-level and identical across formats.

Related Content

Last updated: 22 April 2026

Share this guide:

Validate your invoice

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

Fix cvc-complex-type.2.1 with one click

Upload your invoice and we'll suggest a fix for your review before applying it.