TypeCode exactly once

Error FX-SCH-A-000616 Factur-X

Element 'ram:TypeCode' must occur exactly 1 times.

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

ram:AdditionalReferencedDocument does not contain exactly one ram:TypeCode. The element is either missing or occurs more than once.

What the rule means

ram:TypeCode specifies the type of the additional referenced document. Exactly one occurrence is required to identify the document type unambiguously.

Please provide the TypeCode exactly once

The document type is missing from ram:AdditionalReferencedDocument or is specified more than once. This document reference requires exactly one ram:TypeCode.

What to do
  1. Locate the affected ram:AdditionalReferencedDocument in the invoice line’s settlement.
  2. Make sure it contains exactly one ram:TypeCode.
  3. Generate the invoice again and check it once more.
What it looks like
✗ Triggers the message
<ram:AdditionalReferencedDocument/>
✓ Correct
<ram:AdditionalReferencedDocument>
  <ram:TypeCode>TYPE</ram:TypeCode>
</ram:AdditionalReferencedDocument>
Technical details

The test counts direct ram:TypeCode elements within ram:AdditionalReferencedDocument and requires exactly one.

Where the rule applies

The rule applies within ram:AdditionalReferencedDocument in the settlement for an invoice line.

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