You are here:  » Not reading the complete xml file


Not reading the complete xml file

Submitted by agreenwood13 on Wed, 2013-10-30 13:45 in

I have an issue where the MagicParser does not seem to be reading the the whole xml file.

I added a count onto my function ad it showed only 4993 records but I know there are more than this, my xml file is over 500mb in size.

Are there any limits set?

Cheers,

Angela.

Submitted by support on Wed, 2013-10-30 13:56

Hello Angela and welcome to the forum!

There is no limit to the size of file that can be processed by Magic Parser - in fact, it was originally designed for just that requirement - the processing of XML files too large to be completely read into memory and traversed using XPATH or simply converting to an array.

However, it is not uncommon for very large files to contain character encoding errors, and how these are handled depends on the version of the underlying XML library that your PHP installation was built against and it may be strict handling in place that is aborting the parse when a character encoding error is encountered. To work around this, I have created "cleansing" versions of Magic Parser which sanitise all data in the stream to either utf-8 or iso-8859-1. These versions are available on the downloads page (see Alternative Distributions section). If you know that your data is declared as either of these encodings try the appropriate version, otherwise try the UTF-8 Cleansing Version first, which is by far the more common encoding in use.

Hope this helps! If there's no difference, let me know, and if possible if you are able to link to the file online (I'll remove before publishing your reply) I'll check it out on my test server for you.

Cheers,
David
--
MagicParser.com