At most one file attachment

Error FX-SCH-A-000284 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

The relevant ram:AdditionalReferencedDocument contains more than one ram:AttachmentBinaryObject element.

What the rule means

The XML structure allows at most one ram:AttachmentBinaryObject, and therefore at most one such attachment, for this referenced document.

Please include no more than one file attachment for the referenced document

More than one file attachment is included for the referenced document with the value 916. Leave no more than one ram:AttachmentBinaryObject.

What to do
  1. Find the ram:AdditionalReferencedDocument whose ram:TypeCode has the value 916.
  2. Check its ram:AttachmentBinaryObject elements and leave no more than one.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:AdditionalReferencedDocument>
  <ram:TypeCode>916</ram:TypeCode>
  <ram:AttachmentBinaryObject/>
  <ram:AttachmentBinaryObject/>
</ram:AdditionalReferencedDocument>
✓ Correct
<ram:AdditionalReferencedDocument>
  <ram:TypeCode>916</ram:TypeCode>
  <ram:AttachmentBinaryObject/>
</ram:AdditionalReferencedDocument>
Technical details

For ram:AdditionalReferencedDocument with ram:TypeCode equal to 916, the number of child ram:AttachmentBinaryObject elements is limited to one.

Where the rule applies

In the document-level ram:AdditionalReferencedDocument whose ram:TypeCode has the value 916.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:AdditionalReferencedDocument[ram:TypeCode="916"]
Test expression (assert/@test)
count(ram:AttachmentBinaryObject)<=1