1 Answer
1

It sounds like you have an encoding problem. The single quotes are likely not the single quote character as found on your keyboard but rather a fancier one generated by a word pressing program. The result is likely that your input file is not UTF-8, but rather another multibyte character set.

You either need to convert the encoding with a text editor to make the file completely UTF-8, or use PHP's iconv to convert from the encoding of the file (probably ISO-8859-1) to UTF-8 encoding and then load it with simplexml_load_string.

Well, as I said, I'm not the creator of the XML, but I just load and parse it .. So is there a way to do that from my side?
–
sikasSep 16 '12 at 19:36

1

When you said you didn't create it, I didn't realize you meant you have no write access to it but rather it's a remote URL. In that case, load the URL with cURL or file_get_contents(url), convert the encoding with iconv, then load with simplexml_load_string. That will all be done in memory without access to the physical file.
–
jimpSep 16 '12 at 19:39