DT-CIUS-PT-003_cn
The BT-3 only allows the following values: 381, NC.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
[DT-CIUS-PT-003] The BT-3 only allows the following values: 381, NC.
//cn:CreditNote/cbc:CreditNoteTypeCode
(matches(.,'^([A-Z0-9]{2,3})$') and contains('381,NC,', concat(normalize-space(.), ',')))
Checked with Portugal CIUS-PT Invoice (UBL), Portugal CIUS-PT Credit Note (UBL)