CFDI40186

El valor del campo Importe que corresponde a Retención no se encuentra entre el limite inferior y superior permitido (…, … × …).

In English The Importe of a line's withholding must be Base times TasaOCuota, within the limits of Anexo 20.

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
cfdi:Concepto/cfdi:Impuestos/cfdi:Retenciones/cfdi:Retencion
Test
mx:between(@Base, @TasaOCuota, false(), @Importe)

Checked with CFDI 4.0