VRBL-INV-DK-1p0-3

Basic Info

Rule If the Seller Endpoint ID is marked as a Danish DIGSTORG, it must consist of an optional "DK" prefix, followed by 8 digits.
Context /ubl:Invoice/cac:AccountingSupplierParty/cac:Party/cbc:EndpointID
Pattern vrbl-invoice-dk-1p0
Severity fatal

Used Template: VRBL-DK-schemeID-0184

Implementation

not(@schemeID = '0184')
or
(
	string-length(normalize-space(.)) = 10
	and
	substring(normalize-space(.), 1, 2) = 'DK'
	and
	string-length(translate(substring(normalize-space(.), 3, 8), $Numerics, '')) = 0
)
or
(
	string-length(normalize-space(.)) = 8
	and
	string-length(translate(normalize-space(.), $Numerics, '')) = 0
)