Hello David,
I have a very strange problem with some files.
I am moving websites to another faster server now and for some files the parsing is not working like it should be.
Most of the files I have transfered give no problem but I have some files that do not parse at all or just some records but not the whole xml file. It makes no difference if it is a small or big xml.
When I look at my code I cannot see any difference between the files that work and those that do not work.
But when I test them local on my laptop everything works OK.
Example: I have 1 file that creates on my laptop 270 records to the database but when I upload the same file to the server it stops after 7 records without any error. Very strange and I cannot see what I am doing wrong, no errors. Very weird.
Maybe you have an idea what can cause that kind of problem?
Loet
Thanks a lot David,
@xml_parser_create("iso-8859-1"); did the trick.
Greetings,
Loet
Hello Loet,
Some things to check....
Firstly, where there is a difference in number of records being read, double check that the file itself is identical in both environments.
Are some of the files that don't parse on the new server being opened by URL? In which case, it could be that URL wrappers are not enabled on the new server. See the links in this thread for more info.
Another possibility is that the files are not declaring their character set correctly, and your new PHP installation is compiled against a stricter version of the libraries. One way to test this is to force a particular character set. It is normally worth trying utf-8 first, and if that makes no difference try iso-8859-1. To do this, open MagicParser.php into a text editor, and search for:
@xml_parser_create();
...and replace both instances with:
@xml_parser_create("utf-8");
Alternatively, try:
@xml_parser_create("iso-8859-1");
Hope this helps,
Cheers,
David.