NFE-331

Rejeição: Informar o CNPJ do adquirente ou do encomendante nesta forma de importação [nItem: …].

In English An import on behalf of or by order of a third party (tpIntermedio 2 or 3) needs the acquirer's CNPJ or CPF.

error: the document is invalid

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.

Context
nfe:infNFe/nfe:det
Test
every $d in $prod/nfe:DI satisfies not($d/nfe:tpIntermedio = ('2', '3')) or $d/nfe:CNPJ or $d/nfe:CPF

Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol