0
I have a file of 960 records where each record has 175 fields, it’s a real estate form. When I ask to loop the 960 records with only 10 fields enabled, it generates an XML error as per photo.
// Loop dos valores
for ( $i = 0; $i<count($res)-1; $i++ ) {
$xml .= '<Imovel>';
$xml.="<DATA>".$res[$i]["Data cadastro"]."</DATA>";
$xml.="<ENDERECO>".$res[$i]["Endereco"]."</ENDERECO>";
$xml.="<BAIRRO>".$res[$i]["Bairro"]."</BAIRRO>";
$xml.="<CIDADE>".$res[$i]["Cidade"]."</CIDADE>";
$xml.="<UF>".$res[$i]["UF"]."</UF>";
$xml.="<EMPREENDIMENTO>".$res[$i]["Empreendimento"]."</EMPREENDIMENTO>";
$xml.="<NUMERO>".$res[$i]["Numero"]."</NUMERO>";
$xml.="<PLACA>".$res[$i]["Referencia"]."</PLACA>";
$xml.="<DORMITORIO>".$res[$i]["Dormitorio"]."</DORMITORIO>";
$xml.="<SUITE>".$res[$i]["Suite"]."</SUITE>";
...
Already when I make this loop just to catch the first record, it returns a XML valid. There are restrictions regarding the generation of XML or there may be an error in the data?
Have you thought about the possibility that the webservice parser has some limitation on the length of the line? Are you passing all the parameters according to the manual? The server has no extension for XML manipulation, such as simplexml?
– Jader A. Wagner
It does not have extension to handle XML but I have found a solution: put everything inside CDATA[] and so searched all the records normally. Does CDATA[] influence the XML file generation time? You can also help me with this question: http://answall.com/questions/31718/comort-insertdatas-xml-dentro-de-um-banco-mysql
– Marcos Vinicius