At most 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

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

What the rule means

The rule limits the number of role codes for the tax representative to one. It does not require a role code to be present.

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

More than one ram:RoleCode element is provided for the tax representative. This rule allows no more than one here.

What to do
  1. Locate ram:SellerTaxRepresentativeTradeParty in the invoice.
  2. Remove the extra ram:RoleCode elements so that no more than one remains.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:SellerTaxRepresentativeTradeParty>
  <ram:RoleCode>1</ram:RoleCode>
  <ram:RoleCode>2</ram:RoleCode>
</ram:SellerTaxRepresentativeTradeParty>
✓ Correct
<ram:SellerTaxRepresentativeTradeParty>
  <ram:RoleCode>1</ram:RoleCode>
</ram:SellerTaxRepresentativeTradeParty>
Technical details

The test counts ram:RoleCode elements directly under ram:SellerTaxRepresentativeTradeParty and requires a count of no more than one.

Where the rule applies

The rule applies to ram:RoleCode within ram:SellerTaxRepresentativeTradeParty.

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