Specify exactly one buyer name

Error FX-SCH-A-000030 Factur-X

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

Within ram:BuyerTradeParty, ram:Name does not occur exactly once. The name element is missing or appears more than once.

What the rule means

The buyer name identifies the buyer party in the invoice. Exactly one ram:Name element is required for this purpose in ram:BuyerTradeParty.

Please include exactly one name for the buyer

ram:Name is missing from the buyer element, or it appears more than once. Exactly one name element identifies the buyer there unambiguously.

What to do
  1. Find ram:Name in ram:BuyerTradeParty.
  2. Add the element if it is missing, or remove duplicates so that it occurs exactly once.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<ram:BuyerTradeParty/>
✓ Correct
<ram:BuyerTradeParty>
  <ram:Name/>
</ram:BuyerTradeParty>
Technical details

The XPath test counts the direct child elements ram:Name within ram:BuyerTradeParty and requires the count to be 1.

Where the rule applies

The rule applies within ram:BuyerTradeParty in the trade agreement.

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