CFDI40141

La clave del campo RegimenFiscal debe corresponder con el tipo de persona (fisica o moral) (…, RFC …).

In English The issuer's RegimenFiscal must be a regime for its kind of person: an RFC of 12 characters is a company (persona moral), of 13 a person (persona física).

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:Emisor
Test
mx:regime(@RegimenFiscal, @Rfc)

Checked with CFDI 4.0