You are here:  » End of file problem


End of file problem

Submitted by johnrand on Thu, 2010-03-18 15:23 in

Hi,

I have an xml file that has about 50,000 records in it, but I can't get passed record 1249, either on my site or using the Magic Parser demo. I assume that I have a problem with the data, but I can't find it. Any suggestions?

Thanks in advance.

John

Submitted by support on Thu, 2010-03-18 15:53

Hi John,

It is possible that it is a timeout problem, but that is unlikely if it always reaches the same record every time; however it is worth checking first by adding the following code to the top of your script:

set_time_limit(0);

PHP would normally indicate if it aborted due to max execution time; however if error and warning messages are suppressed this may not be the case.

More likely, it is most likely a character encoding error. I have two "cleansing" versions of MagicParser.php that clean the input stream into valid UTF-8 or ISO-8859-1 depending on the character set of the source data which normally works around these issues. I'll email these versions to you now to try if it doesn't seem to be anything to do with timeout...

Cheers,
David.

Submitted by johnrand on Thu, 2010-03-18 17:17

Hi David,

I added the "set_time_limit(0)" to the code. It didn't help.

I also tried each of the MagicParser version which you kindly sent, and they didn't help either.

I wondered if you had any other suggestions.

Thanks in advance.

John

Submitted by support on Thu, 2010-03-18 17:50

The other, less common possibility is that it is an improperly encoded entity. If you could reply to email with a link to the XML source causing the problem (or .zip and attach if it is not too large) I'll check it out and see what might be causing the problem...

Cheers,
David.

Submitted by johnrand on Thu, 2010-03-18 19:35

Hi David,

I mailed the link. Thanks for looking at it.

John

Submitted by johnrand on Thu, 2010-03-18 20:23

David,

Thank you so much. You are the best!

The version of MagicParser which you send worked perfectly, processing the entire data feed despite corrupted records.

I really haven't experienced this level of customer support before. You go way beyond what is required.

Thanks again.

John