CFDI40203

El valor del campo TotalImpuestosRetenidos debe ser igual a la suma de los importes registrados en el elemento hijo Retencion (…, …).

In English TotalImpuestosRetenidos must be the sum of the summary's Retencion amounts.

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:Comprobante/cfdi:Impuestos
Test
not(@TotalImpuestosRetenidos) or mx:dec(@TotalImpuestosRetenidos) = $withheld

Checked with CFDI 4.0