VRBL-INV-PH-1p0-2

Basic Info

Rule The value of the Buyer Party ID Scheme ID must be contained in Party Identification Scheme Code List [VRBL-CL-PH-PartyIdentificationScheme] (prefixed by 'VRBL:PH:').
Context /ubl:Invoice/cac:AccountingCustomerParty/cac:Party/cac:PartyIdentification/cbc:ID
Pattern vrbl-invoice-ph-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = @schemeID
codeList = $VRBL-PH-Prefix:$VRBL-CL-PH-PartyIdentificationScheme

Implementation

not(boolean(@schemeID))
or
(
	(
		substring(normalize-space(@schemeID), 1, string-length($VRBL-PH-Prefix)) = $VRBL-PH-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(@schemeID), $VRBL-PH-Prefix),
				substring($VRBL-CL-PH-PartyIdentificationScheme, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-PH-PartyIdentificationScheme,
			concat(
				substring($VRBL-CL-PH-PartyIdentificationScheme, 1, 1),
				substring-after(normalize-space(@schemeID), $VRBL-PH-Prefix),
				substring($VRBL-CL-PH-PartyIdentificationScheme, 1, 1)
			)
		)
	)
)