VRBL-DPA-MX-1p0-62

Basic Info

Rule The value of the Dispatch Line Item Hazardous Item ID must be contained in Hazardous Item ID [VRBL-CL-MX-HazardousItem-ID] (prefixed by 'VRBL:MX:').
Context /ubl:DespatchAdvice/cac:DespatchLine/cac:Item/cac:HazardousItem/cbc:ID
Pattern vrbl-despatchadvice-mx-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = .
codeList = $VRBL-MX-Prefix:$VRBL-CL-MX-HazardousItem-ID
showValues = false

Implementation

not(boolean(.))
or
(
	(
		substring(normalize-space(.), 1, string-length($VRBL-MX-Prefix)) = $VRBL-MX-Prefix
		and
		not(
			contains(
				substring-after(normalize-space(.), $VRBL-MX-Prefix),
				substring($VRBL-CL-MX-HazardousItem-ID, 1, 1)
			)
		)
		and
		contains(
			$VRBL-CL-MX-HazardousItem-ID,
			concat(
				substring($VRBL-CL-MX-HazardousItem-ID, 1, 1),
				substring-after(normalize-space(.), $VRBL-MX-Prefix),
				substring($VRBL-CL-MX-HazardousItem-ID, 1, 1)
			)
		)
	)
)