BR-NL-10
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.
For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier (cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID) MUST be either a KVK (schemeID=0106) or OIN number (schemeID=0190)
cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity[$s]
(not(//cac:AccountingCustomerParty/cac:Party/cac:PostalAddress/cac:Country/cbc:IdentificationCode = 'NL') or contains(concat(' ', string-join(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(//cac:AccountingCustomerParty/cac:Party/cac:PartyLegalEntity/cbc:CompanyID/@schemeID, ' '), ' '), ' 0190 ') ) and (not(cbc:CompanyID) or (cbc:CompanyID/normalize-space(.) != ''))
Checked with Netherlands SI-UBL 2.0 Invoice (NLCIUS), Netherlands SI-UBL 2.0 Credit Note (NLCIUS)
For suppliers in the Netherlands, if the customer is in the Netherlands, the customer's legal entity identifier (/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:BuyerTradeParty/ram:SpecifiedLegalOrganization/ram:ID) MUST be either a KVK (schemeID=0106) or OIN number (schemeID=0190)
ram:BuyerTradeParty[$s]
(not(ram:PostalTradeAddress/ram:CountryID = 'NL') or contains(concat(' ', string-join(ram:SpecifiedLegalOrganization/ram:ID/@schemeID, ' '), ' '), ' 0106 ') or contains(concat(' ', string-join(ram:SpecifiedLegalOrganization/ram:ID/@schemeID, ' '), ' '), ' 0190 ') ) and (ram:SpecifiedLegalOrganization/ram:ID/normalize-space(.) != '')
Checked with Netherlands NLCIUS Invoice (CII)