|
Just a quickie that someone will probably be able to answer quickly...
I am parsing an XML doc, when the parser hits a null node, ie no date eg </nodata> my parser comes up with the a fatal error (Call to a member function on a non-object)
Here is a snippet of the parser, the last line causes the error.
foreach ($element->child_nodes() as $e) {
if (isset($e->tagname)) {
$element=$e->tagname;
$node=$e->first_child();
$data=htmlspecialchars($node->node_value());
I have tried various methods of trying to bypass the line depending on if the node_value is null, but nothing seems to work....I guess I must be missing something here as I am not that good with XML...
Sadly I am limited by the server and can only use PHP4 (so can't get version 5 XML goodies :-( !!!
Please, can anyone suggest anything?
Thanks.
Glen
|