At most one RoleCode

Error FX-SCH-A-001154 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:ManufacturerTradeParty contains more than one ram:RoleCode element. In this context, the element may occur at most once.

What the rule means

The manufacturer’s role must not be repeated in this XML context.

Please use no more than one `ram:RoleCode` for the manufacturer

ram:RoleCode is entered more than once for the manufacturer. Remove the duplicate entry so the role is not specified multiple times.

What to do
  1. Locate ram:ManufacturerTradeParty in the invoice-line product.
  2. Remove any extra ram:RoleCode elements there.
  3. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:ManufacturerTradeParty>
  <ram:RoleCode/>
  <ram:RoleCode/>
</ram:ManufacturerTradeParty>
✓ Correct
<ram:ManufacturerTradeParty>
  <ram:RoleCode/>
</ram:ManufacturerTradeParty>
Technical details

The check counts the direct ram:RoleCode children of ram:ManufacturerTradeParty and passes when their number is at most one.

Where the rule applies

The rule applies to ram:ManufacturerTradeParty of an invoice-line product.

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