Exactly one tax category code required

Error FX-SCH-A-000954 Factur-X

Element 'ram:CategoryCode' must occur exactly 1 times.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

ram:CategoryCode is missing from ram:IncludedTradeTax or occurs more than once. It must occur exactly once in this tax block.

What the rule means

ram:CategoryCode identifies the tax category of the advance payment tax block. Exactly one such element is required by the prescribed structure.

Please provide exactly one tax category code for the advance payment

ram:CategoryCode is missing from tax block ram:IncludedTradeTax or appears more than once. Exactly one such element is provided for this block.

What to do
  1. Open ram:IncludedTradeTax within the advance payment.
  2. Make sure ram:CategoryCode occurs exactly once.
  3. Regenerate the invoice and check it again.
What it looks like
✗ Triggers the message
<ram:IncludedTradeTax/>
✓ Correct
<ram:IncludedTradeTax>
  <ram:CategoryCode/>
</ram:IncludedTradeTax>
Technical details

The test counts ram:CategoryCode elements under ram:IncludedTradeTax and requires exactly one.

Where the rule applies

The rule applies to ram:IncludedTradeTax within the advance payment.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ ram:SpecifiedAdvancePayment/ram:IncludedTradeTax
Test expression (assert/@test)
count(ram:CategoryCode)=1