NFE-1038
Rejeição: DF-e Referenciado não informado (DFeReferenciado/chaveAcesso).
In English Debit notes of type 03 and 04 and credit notes of type 06 must reference the document per item (DFeReferenciado/chaveAcesso).
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.
nfe:infNFe
not($debit = ('03', '04') or $credit = '06') or $itemRefs/nfe:chaveAcesso
Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol