Message

When ReceiptAdvice is a response to Advanced Despatch Advice (D), it MUST contain a Status on the Referred Despatch Advice but it MUST NOT contain any Shipment group. When it is a response to a recived shipment/service (S), it SHALL include the Shipment group but MUST NOT contain any Status on the Referred Despatch Advice.

Context
cbc:ReceiptAdviceTypeCode
Test
((normalize-space(.) = 'D') and not(//cac:Shipment/cbc:ID) and (//cac:DespatchDocumentReference/cbc:DocumentStatusCode)) or ((normalize-space(.) = 'S') and (//cac:Shipment/cbc:ID) and not (//cac:DespatchDocumentReference/cbc:DocumentStatusCode) )
Usage
/ ubl:ReceiptAdvice / cbc:ReceiptAdviceTypeCode
/ ubl:ReceiptAdvice / cac:DespatchDocumentReference / cbc:DocumentStatusCode
/ ubl:ReceiptAdvice / cac:Shipment / cbc:ID