HI Guys, I'm using DOM to parse an xml file. And I am having trouble catching an error that throws when the XML tag is empty and self closed.
eg.
<Title />
$xml=("http://www.exampleUrl.com/xmltoparse.xml");
$xmlDoc = new DOMDocument();
$xmlDoc->load($xml);
$x=$xmlDoc->getElementsByTagName('Root');
for ($i=0; $i<=10; $i++)
{
$id=$x->item($i)->getElementsByTagName('Title')
->item(0)->childNodes->item(0)->nodeValue;
The error I am getting is: "Trying to get property of non-object"
Would appreciate the help.