BR-DE-22

The rule sets below word this rule differently; each wording is shown with its rule set.

error: the document is invalid

Why it fails

  • Two attachments (cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject) have the same filename, often attachment.pdf from a generator that names every file alike.

How to fix it

Give each embedded file a name of its own, such as timesheet-2026-09.pdf and delivery-note-4711.pdf.

What the rule checks

As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.

Message

Das "filename"-Attribut aller "EmbeddedDocumentBinaryObject"-Elemente muss eindeutig sein

Context
/ubl:Invoice | /cn:CreditNote
Test
count(cac:AdditionalDocumentReference) = count(cac:AdditionalDocumentReference[not(./cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename = preceding-sibling::cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename)])

Checked with XRechnung 3.0 Invoice (UBL), XRechnung 3.0 Credit Note (UBL)

Message

Not all filename attributes of the embeddedDocumentBinaryObject elements are unique

Context
/rsm:CrossIndustryInvoice
Test
count(//ram:AdditionalReferencedDocument) = count(//ram:AdditionalReferencedDocument[not(./ram:AttachmentBinaryObject/@filename = preceding-sibling::ram:AdditionalReferencedDocument/ram:AttachmentBinaryObject/@filename)])

Checked with XRechnung 3.0 Invoice (CII)