BR-DE-22: Embedded attachment filename is not unique
Severity: fatal · Syntax: CII, UBL
Official message
Das "filename"-Attribut aller "EmbeddedDocumentBinaryObject"-Elemente muss eindeutig sein
What this means
The filename attribute of every EmbeddedDocumentBinaryObject must be unique. UBL counts AdditionalDocumentReference and compares that with the number of references whose filename does not already appear on a preceding sibling. CII does the same with AdditionalReferencedDocument and AttachmentBinaryObject/@filename.
Typical cause
Two attachments were exported with the same filename, often both "attachment.pdf".
How to fix it
Give each embedded document its own filename.
UBL
<cbc:EmbeddedDocumentBinaryObject mimeCode="application/pdf" filename="anlage-1.pdf">...</cbc:EmbeddedDocumentBinaryObject>CII
<ram:AttachmentBinaryObject mimeCode="application/pdf" filename="anlage-1.pdf">...</ram:AttachmentBinaryObject>
Business term
—
Related rules
Context and assertion
UBL /ubl:Invoice | /cn:CreditNote
CII /rsm:CrossIndustryInvoice
UBL
count(cac:AdditionalDocumentReference) = count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])CII
count(//ram:AdditionalReferencedDocument) = count(//ram:AdditionalReferencedDocument[not(./ram:AttachmentBinaryObject/@filename = preceding-sibling::ram:AdditionalReferencedDocument/ram:AttachmentBinaryObject/@filename)])
Check a file now, free of charge
curl -F "file=@rechnung.xml" https://checkxrechnung.com/v1/validate
Questions
What does BR-DE-22 actually check?
The filename attribute of every EmbeddedDocumentBinaryObject must be unique. UBL counts AdditionalDocumentReference and compares that with the number of references whose filename does not already appear on a preceding sibling. CII does the same with AdditionalReferencedDocument and AttachmentBinaryObject/@filename.
How do I fix BR-DE-22?
Give each embedded document its own filename.
If BR-DE-22 passes, is the invoice legally compliant?
No. This page helps you read this one Schematron assertion. A pass is not a statement about tax law, portal acceptance, or bank overlays.