warningubl-2.1

UBL-SR-04:Empty elements should be removed

UBL elements with no content should be omitted.

Severity
Warning
Rule set
ubl-2.1
Country
All EU
Fix type
CONFIRM
Confidence
90%
Category
structural

Engine Classification

Requires user confirmation before application

What is UBL-SR-04?

UBL-SR-04 is a warning validation rule defined in the ubl-2.1 specification. It validates the AdditionalDocumentReference 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: /Invoice/cac:AdditionalDocumentReference[cbc:DocumentTypeCode='130']

Why This Error Matters

Invoice will be rejected by EN16931 validators. These structural constraints ensure consistent processing by receiving systems.

UBL-SR-04 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: UBL-SR-04
  • ·Specification: ubl-2.1

How to Fix It

1.

Find empty elements

Elements with no text or children

2.

Remove or populate

Delete unnecessary, add content to required

XML Example

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

Before
<!-- Required block is missing -->
<!-- <cac:AdditionalDocumentReference> ... </cac:AdditionalDocumentReference> -->
After
<!-- Add the required block -->
<cac:AdditionalDocumentReference>
  <!-- child elements -->
</cac:AdditionalDocumentReference>

Technical Reference

XPath/Invoice/cac:AdditionalDocumentReference[cbc:DocumentTypeCode='130']
Specubl-2.1
Operationremove_duplicates
StrategyRemove duplicate invoiced object references (DocumentTypeCode 130), keeping the first occurrence

Common Causes

  • ·ERP system exports multiple references where only one is allowed in EN16931
  • ·Data consolidation merged records that should have been deduplicated
  • ·Template or mapping incorrectly configured to output duplicate elements
  • ·Manual editing introduced extra elements
  • ·Invoice conversion from another format did not merge duplicate entries

Seeing this in production? The API handles UBL-SR-04 automatically. See the fix response →

Frequently Asked Questions

UBL elements with no content should be omitted.

Remove empty elements or add required content. You can also use Invoice Navigator's automatic Fixer tool to correct this instantly.

UBL-SR-04 is a warning that may not always cause rejection, but should be addressed for full compliance.

Related Errors

Last updated: 21 February 2026

Share this guide:

Handle UBL-SR-04 Automatically in Your Pipeline

The compliance engine auto-remediates this error with controlled safety policies and evidence pack generation.