VRBL-APR-FR-1p0-27

Basic Info

Rule For outbound messages, if the Document Reference Additional Party Code is not empty, the value of the Document Reference Additional Party Code must be contained in Party Role Code [VRBL-CL-APR-FR-PartyRoleCode].
Context /ubl:ApplicationResponse/cac:DocumentResponse/cac:DocumentReference/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:DocumentReferenceExtension/vrbl:AdditionalParty
Pattern vrbl-ar-fr-1p0
Severity fatal

Used Template: CodeList

Parameter Value
probe = @code
codeList = $VRBL-CL-APR-FR-PartyRoleCode

Implementation

(
	not(starts-with(/ubl:ApplicationResponse/cec:UBLExtensions/cec:UBLExtension/cec:ExtensionContent/vrbl:ApplicationResponseExtension/vrbl:RoutingDetails/vrbl:Receiver, 'GENERIC_PPF')) or @code=''
)
or
(
	not(boolean(@code))
	or
	(
		(
			not(
				contains(
					normalize-space(@code),
					substring($VRBL-CL-APR-FR-PartyRoleCode, 1, 1)
				)
			)
			and
			contains(
				$VRBL-CL-APR-FR-PartyRoleCode,
				concat(
					substring($VRBL-CL-APR-FR-PartyRoleCode, 1, 1),
					normalize-space(@code),
					substring($VRBL-CL-APR-FR-PartyRoleCode, 1, 1)
				)
			)
		)
	)
)