At most one file attachment for the embedded document

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 ram:AdditionalReferencedDocument with type code 916 contains more than one ram:AttachmentBinaryObject element.

What the rule means

ram:AttachmentBinaryObject contains the file attachment for the embedded document. It may occur at most once for this reference.

Please attach no more than one file to the embedded document

More than one ram:AttachmentBinaryObject element is recorded for the embedded document. You can limit the file entry to one element.

What to do
  1. Keep no more than one ram:AttachmentBinaryObject element in the relevant ram:AdditionalReferencedDocument.
  2. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:AdditionalReferencedDocument>
  <ram:TypeCode>916</ram:TypeCode>
  <ram:AttachmentBinaryObject>QQ==</ram:AttachmentBinaryObject>
  <ram:AttachmentBinaryObject>Qg==</ram:AttachmentBinaryObject>
</ram:AdditionalReferencedDocument>
✓ Correct
<ram:AdditionalReferencedDocument>
  <ram:TypeCode>916</ram:TypeCode>
  <ram:AttachmentBinaryObject>QQ==</ram:AttachmentBinaryObject>
</ram:AdditionalReferencedDocument>
Technical details

Within this context, the number of direct ram:AttachmentBinaryObject elements is counted; zero or one is allowed.

Where the rule applies

The rule applies to ram:AttachmentBinaryObject in an ram:AdditionalReferencedDocument with type code 916.

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