cvc-datatype-valid.1.2.1:Value does not match the required XML datatype format
Fix: For xs:decimal: strip thousands separators, convert comma decimals to dots, remove currency symbols and whitespace (1.234,56 becomes 1234.56). For xs:date: convert to ISO 8601 YYYY-MM-DD (31/12/2026 becomes 2026-12-31), disambiguating DD/MM vs MM/DD from the source locale. For xs:boolean: map to true/false or 1/0. Apply the same normalisation at the source by formatting with the invariant culture, then re-validate. Upload your invoice to fix this automatically.
cvc-datatype-valid.1.2.1 is an XML Schema (XSD) validation error meaning a value does not satisfy the lexical rules of its declared simple type. The message reads "'X' is not a valid value for 'Y'." In e-invoicing this usually means a number, date, or boolean is formatted in a locale or style the schema does not allow — a comma decimal separator, a DD/MM/YYYY date, or 'Yes'/'No' for a boolean.
Engine Classification
Parse the error message to identify the invalid value and target type, then normalize common formatting issues (decimal separator, date format, boolean)
Confidence: 70% · Applied automatically in pipeline
What is cvc-datatype-valid.1.2.1?
cvc-datatype-valid.1.2.1 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-datatype-valid.1.2.1 is a hard failure — the invoice must be corrected and re-sent before it can reach the recipient.
Incorrectly formatted values make the invoice unparseable by receiving systems. Even if the intended value is correct, the wrong format means automated processing will reject the invoice.
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-datatype-valid.1.2.1
- ·Specification: xsd
How to Fix It
Check the error details
The error message identifies the invalid value and what type was expected. For example: '1.234,56 is not a valid value for decimal' means the number uses continental formatting.
Fix number formatting
Use dot (.) as decimal separator, no thousand separators: 1234.56, not 1.234,56 or 1,234.56.
Fix date formatting
Use ISO 8601 format: YYYY-MM-DD (e.g., 2026-03-12), not DD/MM/YYYY or MM/DD/YYYY.
Update software locale settings
If this error occurs consistently, check your invoicing software's locale and number format settings for XML export.
Before / After
<cbc:IssueDate>31/12/2026</cbc:IssueDate><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID="EUR">1.234,56</cbc:LineExtensionAmount><cbc:PayableAmount currencyID="EUR">1.469,13</cbc:PayableAmount></cac:LegalMonetaryTotal>
<cbc:IssueDate>2026-12-31</cbc:IssueDate><cac:LegalMonetaryTotal><cbc:LineExtensionAmount currencyID="EUR">1234.56</cbc:LineExtensionAmount><cbc:PayableAmount currencyID="EUR">1469.13</cbc:PayableAmount></cac:LegalMonetaryTotal>
Technical Reference
__from_error_message__Code Example
cbc:IssueDate is xs:date and requires YYYY-MM-DD, so 31/12/2026 is rewritten as 2026-12-31. The amount elements are xs:decimal, which forbids comma decimals and thousands grouping, so 1.234,56 becomes 1234.56. These normalisations are deterministic for unambiguous values, so Invoice Navigator can auto-apply them with high confidence.Common Causes
- ·A value breaks its XSD lexical type: comma or grouped decimals instead of dot-decimal; non-ISO dates; dateTime missing time/timezone; boolean as Yes/No; currency symbols or whitespace inside numeric elements; or locale grouping separators from a number formatter.
Seeing this in production? The API handles cvc-datatype-valid.1.2.1 automatically. See the fix response →
Commonly Seen In
Frequently Asked Questions
An XML Schema error: a value does not match the lexical format of its declared simple type. The message tells you the bad value (X) and the expected datatype (Y), such as xs:decimal or xs:date.
xs:decimal requires a dot decimal separator and forbids thousands grouping. 1.234,56 uses a comma decimal and a period thousands separator, neither accepted. The valid form is 1234.56.
Date elements are xs:date and require ISO 8601 YYYY-MM-DD (e.g. 2026-12-31). Formats like 31/12/2026 or 12.31.2026 fail. dateTime values additionally need a time and usually a timezone.
Yes for unambiguous cases (confidence 0.70): we normalise decimal separators, strip grouping and currency symbols, and convert clearly-ordered dates to ISO 8601. We ask for confirmation when a date is genuinely ambiguous (e.g. 03/04/2026) since guessing could change the invoice meaning.
Related Errors
Related Content
Last updated: 10 June 2026
Validate your invoice
Drop your XML here to check for cvc-datatype-valid.1.2.1
Auto-fix cvc-datatype-valid.1.2.1 in seconds
Upload your invoice and we fix this error automatically. Financial fields are never touched.