BR-FREXT-11
The rule sets below word this rule differently; each wording is shown with its rule set.
What the rule checks
As the rule set's publisher wrote it. The rule runs on every element the context matches, and fails where the test is false; the validator reports the line of that element.
Num Fact : … , Num line : … , ParentID : … - [BR-FREXT-11]-Each "Identifier of parent line" (EXT-FR-FE-162) must refer to an existing "Invoice line Identifier" (BT-126) of another invoice line (BG-25).
(cac:InvoiceLine|cac:CreditNoteLine)
($isParentID and exists((../cac:InvoiceLine|../cac:CreditNoteLine)[cbc:ID = $parentID][cbc:ID != $lineID])) or not($isParentID)
Checked with France EXTENDED-CTC-FR (UBL)
Num line : … , ParentID : … - [BR-FREXT-11]-Each "Identifier of parent line" (EXT-FR-FE-162) must refer to an existing "Invoice line Identifier" (BT-126) of another invoice line (BG-25).
//ram:IncludedSupplyChainTradeLineItem
($parentID != '' and exists(/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem[ram:AssociatedDocumentLineDocument/ram:LineID = $parentID and ram:AssociatedDocumentLineDocument/ram:LineID != $lineID])) or $parentID = ''
Checked with France EXTENDED-CTC-FR (CII)