XRechnung 2.1.0 · UBL

BR-DE-22

XRechnung 2.1.0 · UBL

fatalcountry

Original rule text

[BR-DE-22] Das "filename"-Attribut aller "EmbeddedDocumentBinaryObject"-Elemente muss eindeutig sein

Stored validation assertion
count(cac:AdditionalDocumentReference) =                      count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])

What this rule requires

The rule requires that within an invoice or credit note, every cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename value is unique. The test compares the total number of cac:AdditionalDocumentReference elements with the number whose filename is not equal to any preceding sibling's filename. If the same filename appears more than once, the later duplicate is excluded from the count, the numbers differ, and the document fails validation.

How to fix

Set the filename attribute on each cbc:EmbeddedDocumentBinaryObject to a distinct value within the document. Review all cac:AdditionalDocumentReference entries with attachments and rename any duplicate filenames before sending. If the same file is attached multiple times, give each instance a unique filename.

Guidance on this rule. The original text above is authoritative.