Provide no more than one tax representative role code

Error FX-SCH-A-000758 Factur-X

Element 'ram:RoleCode' 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

ram:SellerTaxRepresentativeTradeParty contains more than one ram:RoleCode element. In this context, ram:RoleCode may occur no more than once.

What the rule means

The rule limits the number of role codes in the seller’s tax representative details to no more than one.

Please provide no more than one role code for the seller’s tax representative

The seller’s tax representative details contain multiple ram:RoleCode elements. This section allows no more than one such element.

What to do
  1. Remove any extra ram:RoleCode elements from ram:SellerTaxRepresentativeTradeParty.
  2. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:SellerTaxRepresentativeTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
  <ram:RoleCode>B</ram:RoleCode>
</ram:SellerTaxRepresentativeTradeParty>
✓ Correct
<ram:SellerTaxRepresentativeTradeParty>
  <ram:RoleCode>A</ram:RoleCode>
</ram:SellerTaxRepresentativeTradeParty>
Technical details

The test counts direct ram:RoleCode elements in the ram:SellerTaxRepresentativeTradeParty context and allows no more than one.

Where the rule applies

The rule applies to ram:RoleCode within ram:SellerTaxRepresentativeTradeParty in the invoice agreement.

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