NFE-351
Rejeição: Valor do ICMS da Operação no CST=51 difere do produto BC e Alíquota [nItem: …] (vICMSOp …).
In English With ICMS CST 51, vICMSOp is not vBC × pICMS (R$ 0.01 tolerance).
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/nfe:det
$cst != '51' or br:product($icms/nfe:vICMSOp, br:dec($icms/nfe:vBC) * br:dec($icms/nfe:pICMS) div 100)
Checked with NF-e 4.00, NF-e 4.00 with authorisation protocol