Provide no more than one tax representative role code

Error FX-SCH-A-000674 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

In ram:BuyerTaxRepresentativeTradeParty, ram:RoleCode occurs more than once. The element may appear at most once.

What the rule means

The rule limits the number of role codes for the buyer’s tax representative to one; ram:RoleCode is optional.

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

The buyer’s tax representative has multiple ram:RoleCode elements. The role code may be omitted, but it must not occur more than once.

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

The check tests whether the number of direct ram:RoleCode elements in ram:BuyerTaxRepresentativeTradeParty is at most one.

Where the rule applies

The rule applies to ram:RoleCode within ram:BuyerTaxRepresentativeTradeParty, that is, the buyer’s tax representative.

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