-1

I am getting xml data from the url but XMLReader says xml format is invalid. Can i get any clue about the xml format issue?

I am not expert in XML standard but data seems to be okay with tag wise.

$url = "http://xyz";
$xml = file_get_contents($url);
$folderReader = new XMLReader();  
$folderReader->XML($xml);          //returns true

var_dump($folderReader->isValid());  //bool(false)

print_r($folderReader);  //XMLReader Object ( ) 
P K
  • 9,972
  • 12
  • 53
  • 99

1 Answers1

1

I found this on php website

"isValid() always returns false unless you enable checking for validity by: $reader->setParserProperty(XMLReader::VALIDATE, true);"

Pawel Dubiel
  • 18,665
  • 3
  • 40
  • 58