At most one tax registration for the buyer agent

Error FX-SCH-A-000652 Factur-X

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

SpecifiedTaxRegistration occurs more than once in BuyerAgentTradeParty. This element may appear there at most once.

What the rule means

The XML structure allows at most one tax registration element for the buyer agent. Multiple occurrences do not conform to this structure.

Please use at most one tax registration for the buyer agent

The invoice contains multiple SpecifiedTaxRegistration elements for the buyer agent. You can resolve this by limiting the number of these elements to one.

What to do
  1. Find SpecifiedTaxRegistration within BuyerAgentTradeParty.
  2. Remove the extra occurrences so that no more than one element remains.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:BuyerAgentTradeParty>
  <ram:SpecifiedTaxRegistration/>
  <ram:SpecifiedTaxRegistration/>
</ram:BuyerAgentTradeParty>
✓ Correct
<ram:BuyerAgentTradeParty>
  <ram:SpecifiedTaxRegistration/>
</ram:BuyerAgentTradeParty>
Technical details

The test counts the direct SpecifiedTaxRegistration child elements of BuyerAgentTradeParty and requires the count to be less than or equal to one.

Where the rule applies

The rule applies to the SpecifiedTaxRegistration element within BuyerAgentTradeParty.

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