ID: 47953 Updated by: [email protected] Reported By: bbarnett at gt dot co dot cr Status: Bogus Bug Type: SimpleXML related Operating System: WXP PHP Version: 5.2.9 New Comment:
Not a bug. You have bad data - most likely an invisible char. Previous Comments: ------------------------------------------------------------------------ [2009-04-15 15:58:53] bbarnett at gt dot co dot cr I'm adding the XML head to the string like this <?xml version="1.0" encoding="UTF-8"?> <X_A_PagoGen> <Banco>2</Banco> <Localizacion>7901160655</Localizacion> <NotaCredito>000000009726</NotaCredito> <Correlativo>79613565</Correlativo> <Self>5</Self> <Monto>0000010605</Monto> <Agencia>1400</Agencia> <FechaPago>20090102</FechaPago> <FechaCaja>20090105</FechaCaja> </X_A_PagoGen> But I'm receiving the same result. In the next case the function read the XML without problem <X_C_Localizacion> <Localizacion>7901160655</Localizacion> </X_C_Localizacion> ------------------------------------------------------------------------ [2009-04-15 15:40:06] bbarnett at gt dot co dot cr I try without the utf8_decode, but I'm receiving the same result. $xml2= simplexml_load_string(trim($reg[0])); Can you help me? ------------------------------------------------------------------------ [2009-04-15 11:55:16] [email protected] There's bad data somewhere in your XML. No idea what encoding the data is, but converting it to ISO-8859-1 without an XML declaration using that encoding is a sure path to disaster. ------------------------------------------------------------------------ [2009-04-12 00:07:46] bbarnett at gt dot co dot cr This is a part of the code that I'm using: <? $consulta="select trama from gestiones where consecutivo=".trim($_REQUEST['consecutivo']); $buffconsulta = mssql_query($consulta,$conn); $reg = mssql_fetch_row($buffconsulta); // Procesa el XML enviado $xml2= simplexml_load_string(utf8_decode(trim($reg[0]))); if (!$xml2){ print wordwrap($reg[0], 30, "<br>",1); } ?> ------------------------------------------------------------------------ [2009-04-12 00:03:21] bbarnett at gt dot co dot cr This is an example of the XML string that I'm trying to read <X_A_PagoGen> <Banco>2</Banco> <Localizacion>8203261610</Localizacion> <NotaCredito>000000009770</NotaCredito> <Correlativo>80782584</Correlativo> <Self>9</Self> <Monto>0000011930</Monto> <Agencia>1400</Agencia> <FechaPago>20090216</FechaPago> <FechaCaja>20090217</FechaCaja> </X_A_PagoGen> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/47953 -- Edit this bug report at http://bugs.php.net/?id=47953&edit=1
