Exactly one buyer postal address

Error FX-SCH-A-000419 Factur-X

Element 'ram:PostalTradeAddress' 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:PostalTradeAddress does not occur exactly once in ram:BuyerTradeParty. The element is either missing or occurs more than once.

What the rule means

The buyer information must contain exactly one postal address element so that the address is provided in the required structure.

Please provide exactly one postal address for the buyer

The buyer information is missing ram:PostalTradeAddress or contains it more than once. Including exactly one such element corrects this issue.

What to do
  1. Check ram:BuyerTradeParty for ram:PostalTradeAddress.
  2. Make sure exactly one ram:PostalTradeAddress element is present.
  3. Generate the invoice again and validate it again.
What it looks like
✗ Triggers the message
<ram:BuyerTradeParty/>
✓ Correct
<ram:BuyerTradeParty>
  <ram:PostalTradeAddress/>
</ram:BuyerTradeParty>
Technical details

The XPath test count(ram:PostalTradeAddress)=1 checks that exactly one direct ram:PostalTradeAddress child element is present.

Where the rule applies

The rule applies to ram:PostalTradeAddress within the buyer information ram:BuyerTradeParty.

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