CFDI40155

Para registrar el campo NumRegIdTrib, el CFDI debe contener el complemento de comercio exterior y el RFC del receptor debe ser un RFC genérico extranjero.

In English A foreign receiver (XEXX010101000) of a CFDI with the Comercio Exterior complement must have its tax number in NumRegIdTrib.

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:Receptor
Test
not($foreign and $cce) or @NumRegIdTrib

Checked with CFDI 4.0