XV-GR-12
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
documentIdNo and countryDocumentId (an identity document, such as a passport) are accepted only on a tax free invoice (specialInvoiceCategory 4).
inv:issuer | inv:counterpart
(empty(inv:documentIdNo) and empty(inv:countryDocumentId)) or ancestor::inv:invoice/inv:invoiceHeader/inv:specialInvoiceCategory = '4'
Checked with myDATA 2.0.2
countryDocumentId is the country that issued documentIdNo and is given with it.
inv:issuer | inv:counterpart
empty(inv:countryDocumentId) or exists(inv:documentIdNo)
Checked with myDATA 2.0.2