CFDI140227

Cuando en el campo ObjetoImp se registre el valor "07", el valor "002" (IVA) en el campo "Impuesto" de los nodos hijo "Retencion" y/o "Traslado" del elemento "Retenciones" y/o "Traslados" a nivel Concepto no debe existir; debe existir el valor "003" (IEPS) en el campo "Impuesto" del nodo hijo "Traslado" del elemento "Traslados" a nivel Concepto.

In English A line with ObjetoImp 07 (no VAT, IEPS broken down) must have no VAT (002) and must have a transferred IEPS (003).

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:Conceptos/cfdi:Concepto
Test
not(@ObjetoImp = '07') or (not($imp/*/*[@Impuesto = '002']) and $imp/cfdi:Traslados/cfdi:Traslado[@Impuesto = '003'])

Checked with CFDI 4.0