At most one ram:SubjectCode per ram:IncludedNote

Error FX-SCH-A-001013 Factur-X

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

The same ram:IncludedNote contains ram:SubjectCode more than once.

What the rule means

A note contains no more than one subject code in ram:SubjectCode. Multiple occurrences do not conform to the structure checked by this rule.

Please use only one `ram:SubjectCode` in each `ram:IncludedNote`

A note associated with the invoice line document contains multiple ram:SubjectCode elements. The structure allows at most one in each ram:IncludedNote.

What to do
  1. Keep no more than one ram:SubjectCode within the note.
  2. Regenerate the invoice and validate it again.
What it looks like
✗ Triggers the message
<ram:IncludedNote>
  <ram:SubjectCode>CODE-1</ram:SubjectCode>
  <ram:SubjectCode>CODE-2</ram:SubjectCode>
</ram:IncludedNote>
✓ Correct
<ram:IncludedNote>
  <ram:SubjectCode>CODE-1</ram:SubjectCode>
</ram:IncludedNote>
Technical details

The test counts the ram:SubjectCode elements within the current ram:IncludedNote and allows no more than one.

Where the rule applies

The rule applies to the subject code of a note (ram:IncludedNote) associated with the invoice line document.

Context (rule/@context)
/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ ram:AssociatedDocumentLineDocument/ram:IncludedNote
Test expression (assert/@test)
count(ram:SubjectCode)<=1