Fix malformed XML in PHP before processing using DOMDocument functions

To solve this issue, set the DomDocument recover property to TRUE before loading XML Document

$dom->recover = TRUE;

Try this code:

$feedURL = '3704017_14022010_050004.xml';
$dom = new DOMDocument();
$dom->recover = TRUE;
$dom->load($feedURL);

Leave a Comment