NFE-253

Rejeição: Digito Verificador da chave de acesso composta inválida (cDV …, calculado …).

In English cDV is not the modulo 11 check digit of the 43 digits of the access key (weights 2 to 9 from the right, 0 when the result is 10 or 11).

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
Test
not(matches($key43, '^[0-9]{6}[0-9A-Z]{12}[0-9]{25}$')) or br:mod11($key43) = br:dec($ide/nfe:cDV)

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