XML-003:XML encoding declaration recommended
Fix: Add XML declaration with UTF-8 encoding.
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.
The invoice may pass transmission, but this non-compliance can cause problems during tax audits or buyer-side processing.
Target path: XPath: XML declaration
Why This Error Matters
Encoding ensures proper character handling.
XML-003 is a soft failure that can cause issues at the receiving end — tax audits, ERP processing, or VAT reconciliation mismatches.
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. This error involves a protected field — Invoice Navigator flags it in your pipeline so your team can correct it at the source.
XML-003 is a warning that should be addressed.
Related Errors
Related Content
Last updated: 3 March 2026
Validate your invoice
Drop your XML here to check for XML-003
Detect XML-003 before submission
This error involves a financial field that can't be auto-modified. We'll flag it with a clear diagnosis so you can fix it at the source.