You are here:  » Continue on Error routine?


Continue on Error routine?

Submitted by georgop on Thu, 2011-07-28 16:41 in

Running into the same problem, in that Magic Parser stops reading records when it encounters a special character. I tried writing "cleansing" routines in myRecordHandler, but this error causes Magic Parser to quit prior to invoking myRecordHandler.

Is there some way to skip the offending record and continue reading the rest of the "good records"?

Submitted by support on Thu, 2011-07-28 17:29

Hi georgop,

It's actually the underlying XML library that aborts the parse on encountering an invalid character. but the exact behaviour varies depending upon PHP version and the version of the underlying XML library that it has been linked with. Some combinations are completely tolerant of character encoding errors, whereas others will abort. Further permutations include whether or not data must be valid according to the declared character encoding in the XML source.

I have "cleansing" versions of Magic Parser that make sure that all input data is either valid utf-8 or iso-8859-1 as required which I will email to you now; almost certainly one of them will enable you to parse your data completely...

All the best,
David.
--
MagicParser.com

Submitted by georgop on Thu, 2011-07-28 18:21

Thank you David, will give it a try!