Include ram:ID no more than once

Error FX-SCH-A-000708 Factur-X

Element 'ram:ID' 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:ProductEndUserTradeParty contains more than one ram:ID element.

What the rule means

ram:ID is optional in this party element but may occur only once. Multiple identifiers at this location do not conform to the required structure.

Please include the product end user’s identifier no more than once

ram:ID appears multiple times in ram:ProductEndUserTradeParty. The identifier may appear at most once in this element.

What to do
  1. Find the relevant ram:ProductEndUserTradeParty.
  2. Remove any extra ram:ID elements there, or omit ram:ID if no identifier is to be provided.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:ProductEndUserTradeParty>
  <ram:ID>123</ram:ID>
  <ram:ID>456</ram:ID>
</ram:ProductEndUserTradeParty>
✓ Correct
<ram:ProductEndUserTradeParty>
  <ram:ID>123</ram:ID>
</ram:ProductEndUserTradeParty>
Technical details

The test counts the direct ram:ID elements in the current ram:ProductEndUserTradeParty and allows no more than one.

Where the rule applies

The rule applies to ram:ID within ram:ProductEndUserTradeParty in the invoice agreement.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ ram:ProductEndUserTradeParty
Test expression (assert/@test)
count(ram:ID)<=1