XML-003:XML encoding declaration recommended
XML should declare character encoding.
Engine Classification
Financial or legal field · Modification blocked by policy
Reason: XML encoding declaration should be specified to ensure correct character interpretation. Adding or changing encoding declarations could alter how special characters are processed. Configure your invoicing software to include the encoding declaration (typically UTF-8) in the XML output.
What is XML-003?
XML-003 is a warning validation rule defined in the ubl-2.1 specification. It validates the XPath: XML declaration element in the UBL invoice XML.
This is a soft validation failure. The invoice may pass initial transmission, but non-compliant values in this field can cause problems during tax audits, buyer-side processing, or downstream VAT reconciliation.
Target path: XPath: XML declaration
Why This Error Matters
Encoding ensures proper character handling.
XML-003 is a soft failure. The invoice may pass initial validation, but the non-compliant field can cause issues at the receiving end — tax authorities may flag it during audits, buyer ERP systems may fail to process it, or VAT reconciliation may produce mismatches. Fixing warnings before they accumulate prevents larger compliance gaps.
Validator Behavior
- ·Generates validation warning
- ·Fails UBL schema validation
- ·Error returned: XML-003
- ·Specification: ubl-2.1
How to Fix It
Add declaration
<?xml version="1.0" encoding="UTF-8"?>
Use UTF-8
Standard encoding for invoices
XML Example
Generic example based on the rule's target XPath. Your actual XML structure may differ.
<!-- Triggers validation error --> <XPath: XML declaration></XPath: XML declaration>
<!-- Corrected --> <XPath: XML declaration>VALID_VALUE</XPath: XML declaration>
Technical Reference
XPath: XML declarationCommon Causes
- ·Missing declaration
- ·Wrong encoding
Seeing this in production? The API handles XML-003 automatically. See the fix response →
Frequently Asked Questions
XML should declare character encoding.
Add XML declaration with UTF-8 encoding. Invoice Navigator can help identify and fix this issue.
XML-003 is a warning that should be addressed.
Related Errors
Last updated: 19 January 2026
Handle XML-003 Automatically in Your Pipeline
The compliance engine auto-remediates this error with controlled safety policies and evidence pack generation.