Provide at most one binary attachment for each additional referenced document

Error FX-SCH-A-001018 Factur-X

Element 'ram:AttachmentBinaryObject' may occur at maximum 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

A ram:AdditionalReferencedDocument contains more than one ram:AttachmentBinaryObject. This element may occur at most once there.

What the rule means

The binary object contains the attachment for the additional referenced document. Multiple binary objects at this location do not conform to the intended XML structure.

Please attach no more than one binary file to the additional referenced document

More than one binary attachment is entered for an additional referenced document on an invoice line. Use no more than one ram:AttachmentBinaryObject there.

What to do
  1. Find the affected ram:AdditionalReferencedDocument on the invoice line.
  2. Leave no more than one ram:AttachmentBinaryObject in it.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:AdditionalReferencedDocument>
  <ram:AttachmentBinaryObject>fichier 1</ram:AttachmentBinaryObject>
  <ram:AttachmentBinaryObject>fichier 2</ram:AttachmentBinaryObject>
</ram:AdditionalReferencedDocument>
✓ Correct
<ram:AdditionalReferencedDocument>
  <ram:AttachmentBinaryObject>fichier</ram:AttachmentBinaryObject>
</ram:AdditionalReferencedDocument>
Technical details

The check counts child ram:AttachmentBinaryObject elements and passes when their number is at most one.

Where the rule applies

The rule applies to ram:AdditionalReferencedDocument of an invoice line in the trade line agreement section.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:SpecifiedLineTradeAgreement/ram:AdditionalReferencedDocument
Test expression (assert/@test)
count(ram:AttachmentBinaryObject)<=1