DT-CIUS-PT-020_11.2
The BT-22 when prefixed with '#WITHHOLDINGTAXTYPE@WITHHOLDINGTAX-000#', only admits the following values: IRF.
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(.),'#WITHHOLDINGTAXTYPE@WITHHOLDINGTAX-') and not(contains('IRF,', concat(normalize-space(substring-before(substring-after(.,$wht20_11),'#')), ',')))
Checked with Portugal CIUS-PT Invoice (UBL), Portugal CIUS-PT Credit Note (UBL)