I have the following problem, when reading an xml of an invoice I am presented with a Warning with a specific invoice format. This is not happening to me with another group of invoices that I can process. Then I leave the Warning that is generating me.
Warning:
Warning: SimpleXMLElement::__construct(): tmp/CAMF840207IB3-20180108T181935.xml:20: namespace error : xmlns:schemaLocation: ' http://www.sat.gob.mx/registrofiscal http://www.sat.gob. mx/sitio_internet/cfd/cfdiregistrofiscal/cfdiregistrofiscal.xsd ' is not a valid URI in /opt/lampp/htdocs/cajachica/models/archivo_model.php on line 75
Line code 75
$xml = new SimpleXMLElement($path."/".$archivo,null,TRUE);
The line where the error is being generated is the following:
<cfdi:Complemento>
<registrofiscal:CFDIRegistroFiscal xmlns:schemaLocation="http://www.sat.gob.mx/registrofiscal http://www.sat.gob.mx/sitio_internet/cfd/cfdiregistrofiscal/cfdiregistrofiscal.xsd" Version="1.0" Folio="XXXXXXXXXXXX" xmlns:registrofiscal="http://www.sat.gob.mx/registrofiscal"></registrofiscal:CFDIRegistroFiscal>
The section of code where I'm registering to the namespace :
$xml->registerXPathNamespace('reg',$namespaces['registrofiscal']);
This worked for me to read the CFDIs that come in the Fiscal Registry plugin: CFDIRegistroFiscal
It also helped me a lot to put the line
Since this happened to me with the CFDIs (which start with AAA), these were stamped with a password, instead of FIEL. They refer to a SAT page that tries to access an object that cannot be read by the server.
Be careful, because in the invoices that are a payment complement, the Folio is in the complement;