At most one AttachmentBinaryObject

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

An ram:AdditionalReferencedDocument of the invoice line contains multiple ram:AttachmentBinaryObject elements. This element may occur no more than once there.

What the rule means

This limit ensures that at most one binary attachment is associated with a referenced document in this XML context.

Please use no more than one AttachmentBinaryObject for the referenced document

Multiple binary attachments are specified for the referenced document of an invoice line. You can limit the XML entry to no more than one attachment.

What to do
  1. Check ram:AdditionalReferencedDocument on the affected invoice line.
  2. Remove any extra ram:AttachmentBinaryObject elements so that no more than one remains.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<ram:AdditionalReferencedDocument>
  <ram:AttachmentBinaryObject/>
  <ram:AttachmentBinaryObject/>
</ram:AdditionalReferencedDocument>
✓ Correct
<ram:AdditionalReferencedDocument>
  <ram:AttachmentBinaryObject/>
</ram:AdditionalReferencedDocument>
Technical details

The Schematron condition counts the ram:AttachmentBinaryObject elements in context and requires the count to be no greater than one.

Where the rule applies

The rule applies to ram:AdditionalReferencedDocument on the agreement level of an invoice line.

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