Re: XML coming out from MySQL

From: Date: Sat, 10 Nov 2001 12:00:01 +0000
Subject: Re: XML coming out from MySQL
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-14213@lists.php.net to get a copy of this message
> I've never parsed XML with PHP, but it might help if you can show the > document that's breaking the parser, and also let us know if other > documents are working fine... > > -Lorenzo Hi, The document is like this: <?xml version="1.0" encoding="iso-8859-1"?> <articulo> <volanta>Some text</volanta> <titulo>Some text</titulo> <bajada>Some text</bajada> <parrafo>Some text</parrafo> <url>http://whatever.com/</url> <copy>Whomever 2001</copy> </articulo> Up to now, I solve the problem modifying the lines saying > while ($data = $file) { > if (!xml_parse($xml_parser, $data, 0)) { > die(sprintf("XML error: %s at line %d", > xml_error_string(xml_get_error_code($xml_parser)), > xml_get_current_line_number($xml_parser))); > } > } into > xml_parse($xml_parser, $data, 0); I'd noticed that I don't need to read the document line by line. Regards and thanks, Tomás +-- --+ Tomás García Ferrari Bigital http://bigital.com/ +-- --+

« previous php.db (#14213) next »