warningsyntaxubl-2.1

XML-003:XML encoding declaration recommended

Fix: Add XML declaration with UTF-8 encoding.

XML should declare character encoding.

Severity
Warning
Rule set
ubl-2.1
Country
All EU
Fix type
BLOCKED

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

This error requires manual correction — financial fields are protected by policy.

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

1.

Add declaration

<?xml version="1.0" encoding="UTF-8"?>

2.

Use UTF-8

Standard encoding for invoices

XML Example

Generic example based on the rule's target XPath. Your actual XML structure may differ.

Before
<!-- Triggers validation error -->
<XPath: XML declaration></XPath: XML declaration>
After
<!-- Corrected -->
<XPath: XML declaration>VALID_VALUE</XPath: XML declaration>

Technical Reference

XPathXPath: XML declaration
Specubl-2.1

Common 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

Share this guide:

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.