![]() |
Trouble reading XML/RSS files, any help appreciated! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Trouble reading XML/RSS files, any help appreciated! (/showthread.php?tid=21973) |
Trouble reading XML/RSS files, any help appreciated! - El Forum - 08-25-2009 [eluser]jonhurlock[/eluser] Ive created a function which gets the latest news from different sites XML/RSS feeds, in this case i've done an example using a Twitter RSS feed, for a twitter search query, it then displays the results from the RSS feed on my site. Basically i randomly keep on getting errors which looks like the following: Quote:A PHP Error was encounteredWhen the errors render the line number which is in red (10) keeps on changing. On one load of the page i had several of the same messages but where it displays for lines 10,11,12,13,13,13,13 (I dont understand why it rendered 13 4 times?) The line 103 refers to the line Code: $xmlDoc->load($xml); Is this because the XML did not comply to specifications/is broken or is there something wrong with my code? Because some times the page appears to be fine with no errors, and then every once in a while i get spammed with errors ![]() Eventually i would like to cache the results so my users aren't sending off to many requests to feeds original source Function from my Controller: Code: function output_from_feed(){ Trouble reading XML/RSS files, any help appreciated! - El Forum - 08-26-2009 [eluser]tomcode[/eluser] To avoid getting errors : Code: try Check on parsing errors. Check the presence of the nodes You use. Trouble reading XML/RSS files, any help appreciated! - El Forum - 08-26-2009 [eluser]jonhurlock[/eluser] Try Catch Blocks makes, sense cheers for the suggestion. ![]() |