DT-CIUS-PT-020_13.1
The BT-22 does not meet the defined format: it is mandatory to prefix the value with the following '#REFERENCE@ATMPAYMENT-000#' and suffice with '#'. The sub-suffix "-000" must be used as a group of elements.
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.
//ubl:Invoice/cbc:Note | //cn:CreditNote/cbc:Note
starts-with(normalize-space(.),'#REFERENCE@ATMPAYMENT-') and not(matches(.,'^(#(REFERENCE@ATMPAYMENT)-([0-9]{3})#(.+)#)$'))
Checked with Portugal CIUS-PT Invoice (UBL), Portugal CIUS-PT Credit Note (UBL)