VRBL-INV-PL-B2B-3-93

Basic Info

Rule Invoice Document Reference UUID segments after the issuer and date segments must consist of an upper case hexadecimal identifier with a format like A1B2C3D4E5F6-FF or A1B2C3-D4E5F6-FF.
Context /ubl:Invoice/cac:BillingReference/cac:InvoiceDocumentReference/cbc:UUID
Pattern vrbl-invoice-pl-b2b-3p0
Severity fatal

Implementation

not(string-length(.)>=35 and string-length(.)<=36)
or
not(string-length(translate(., '-', '')) = string-length(.) - 3 or string-length(translate(., '-', '')) = string-length(.) - 4)
or
(
	translate(substring(substring-after(substring-after(., '-'), '-'), 1, 12), '0123456789ABCDEF', '')=''
	and
	substring(substring-after(substring-after(., '-'), '-'), 13, 1)='-'
	and
	translate(substring(substring-after(substring-after(., '-'), '-'), 14, 2), '0123456789ABCDEF', '')=''
)
or
(
	translate(substring(substring-after(substring-after(., '-'), '-'), 1, 6), '0123456789ABCDEF', '')=''
	and
	substring(substring-after(substring-after(., '-'), '-'), 7, 1)='-'
	and
	translate(substring(substring-after(substring-after(., '-'), '-'), 8, 6), '0123456789ABCDEF', '')=''
	and
	substring(substring-after(substring-after(., '-'), '-'), 14, 1)='-'
	and
	translate(substring(substring-after(substring-after(., '-'), '-'), 15, 2), '0123456789ABCDEF', '')=''
)