Allow only one ram:LanguageID element

Error FX-SCH-A-000315 Factur-X

Element 'ram:LanguageID' 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:LanguageID occurs more than once under rsm:ExchangedDocument. At most one such element is allowed in this context.

What the rule means

The limit prevents conflicting or repeated language declarations at this location in the invoice document data.

Please use only one `ram:LanguageID` under `rsm:ExchangedDocument`

The invoice document data contain ram:LanguageID more than once. Remove the duplicate so that the element occurs only once there.

What to do
  1. Find the repeated ram:LanguageID elements under rsm:ExchangedDocument.
  2. Leave no more than one ram:LanguageID element there.
  3. Generate the invoice again and validate it.
What it looks like
✗ Triggers the message
<rsm:ExchangedDocument>
  <ram:LanguageID>de</ram:LanguageID>
  <ram:LanguageID>en</ram:LanguageID>
</rsm:ExchangedDocument>
✓ Correct
<rsm:ExchangedDocument>
  <ram:LanguageID>de</ram:LanguageID>
</rsm:ExchangedDocument>
Technical details

The test counts the direct child elements ram:LanguageID of rsm:ExchangedDocument and allows no more than one.

Where the rule applies

The rule applies directly under rsm:ExchangedDocument in the invoice document data.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:ExchangedDocument
Test expression (assert/@test)
count(ram:LanguageID)<=1