At most one ram:SubjectCode element

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

ram:SubjectCode occurs more than once in ram:IncludedNote.

What the rule means

A note can contain at most one subject code at this location. Multiple ram:SubjectCode elements do not conform to the intended XML structure.

Please include the subject code no more than once

The note on a document associated with an invoice line contains the subject code more than once. You can adjust the XML structure so that ram:IncludedNote contains at most one ram:SubjectCode element.

What to do
  1. Check the repeated ram:SubjectCode elements in ram:IncludedNote.
  2. Ensure that this element occurs no more than once there.
  3. Regenerate the invoice and check it again.
What it looks like
✗ Triggers the message
<ram:IncludedNote>
  <ram:SubjectCode>Code A</ram:SubjectCode>
  <ram:SubjectCode>Code B</ram:SubjectCode>
</ram:IncludedNote>
✓ Correct
<ram:IncludedNote>
  <ram:SubjectCode>Code</ram:SubjectCode>
</ram:IncludedNote>
Technical details

The Schematron check counts the direct ram:SubjectCode elements within ram:IncludedNote and permits no more than one.

Where the rule applies

The rule applies to ram:IncludedNote on the document associated with an invoice line.

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