You are here:  » XML File Loading

Support Forum



XML File Loading

Submitted by autopia on Tue, 2008-05-20 16:34 in

David,

I am creating my own XML files for import. All was working well until I upgraded my server to the most recent stable version of PHP/MySQL. After upgrading my XML feeds stopped load almost entirely. I chased the problem down to special characters. It seems that any character value over 128 decimal causes the feed import to abort.

I tried changing the database collation from latin1 to utf8, thinking it was likely a MySQL issue, but this did not resolve the problem. In desperation I put a filter in my data collection (store reader) script to make character replacements, but this is a total hack and I'd like to fix the actual problem.

What might I be missing?

Thanks,
David

Submitted by support on Tue, 2008-05-20 16:39

Ahh...

It looks like you've run into the rare case of your installation of PHP having been compiled against a buggy version of libxml; in which the character set of an XML document is not automatically detected and therefore any extended characters cause the parser to stop.

Now; there is an easy way out if the character set of all the XML feeds you are working with is the same (for example utf-8 (most likely) or perhaps iso-8859-1). What you need to do is edit includes/MagicParser.php and use your text editor to change both instances of:

@xml_parser_create()

to...

@xml_parser_create("UTF-8")

(or the required character set)

Hopefully that should get you going...

Cheers,
David.

Submitted by autopia on Tue, 2008-05-20 20:08

David,

Well, that put me on the right track. When I changed the XML encoding on my feed generator from UTF-8 to iso-8859-1 I was able to get a clean load on PT.

Thanks!
David