A2 Hosting Forums

Full Version: Warning: simplexml_load_string() - Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to get a script working on my server, which can be located here. For those familiar with World of Warcraft, if it basically a script that pulls data from WoWArmory.com. I had this script successfully working on my old server (Not hosted @ A2) and it worked, now when I try to grab the data from wowarmory.com I receive the following errors.

Code:
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : Space required after the Public Identifier in /home/kastang/public_html/armory/_armory.php on line 97

Warning: simplexml_load_string() [function.simplexml-load-string]: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in /home/kastang/public_html/armory/_armory.php on line 97

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/kastang/public_html/armory/_armory.php on line 97

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : SystemLiteral " or ' expected in /home/kastang/public_html/armory/_armory.php on line 97

Warning: simplexml_load_string() [function.simplexml-load-string]: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in /home/kastang/public_html/armory/_armory.php on line 97

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/kastang/public_html/armory/_armory.php on line 97

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 1: parser error : SYSTEM or PUBLIC, the URI is missing in /home/kastang/public_html/armory/_armory.php on line 97

Warning: simplexml_load_string() [function.simplexml-load-string]: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> in /home/kastang/public_html/armory/_armory.php on line 97

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in /home/kastang/public_html/armory/_armory.php on line 97

Fatal error: Call to a member function xpath() on a non-object in /home/kastang/public_html/armory/create_sig.php on line 84


I attempted to look up this function on google, but honestly I found little to no useful information. Attached is the _armory.php file. I know enough PHP to get me around (I am self taught) and I cannot see anything wrong with it.

From what I have read though, It seems as some people are having other random issues with the script, I believe that the creator of this script based it around his particular hosting/server. Any help would be great, its really not imperative that I get this working but it would be nice to.

Thanks!

The script compiles fine.  It would seem likely there is an error in the data that you are feeding to simplexml_load_string() at line 97.  Being USE_CURL is set to FALSE, it's doing $f = file_get_contents($url); at line 95 of getArmoryDataXML().  I would check that $url that you are sending to that function is correct and then that it's retrieving valid XML data.  A quick way to do that would be to drop something like this in after line 95:

echo '<pre>';
print "URL: $url\n$f\n";;
echo '</pre>';

I pretty sure that's the problem because from the error dump above you have "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">" which is an HTML document, not XML.
Thanks for the help! Turns out that the wowarmory updated its code and the script hasnt been updated yet.
Reference URL's