note 46440 added to function.dom-domdocument-load

From: Date: Mon, 11 Oct 2004 18:57:21 +0000
Subject: note 46440 added to function.dom-domdocument-load
Groups: php.notes 
Request: Send a blank email to php-notes+get-78362@lists.php.net to get a copy of this message
Here is a better example that tells WHY load() failed. <?php # next 2 lines make sure load() error message is in $php_errormsg ini_set( 'track_errors', 1); ini_set('error_reporting', E_ALL | E_STRICT); $doc = new DOMDocument(); $ret = $doc->load("filename"); if ($ret) { print $doc->saveXML(); } else { print "Error loading file: " . $php_errormsg; } ?> There are also cases where load() will succeed, but strip things from the xml. For example, named entities may be stripped, a log warning entry made and load() will still return true. ---- Manual Page -- http://www.php.net/manual/en/function.dom-domdocument-load.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46440 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46440&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+46440&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#78362) next »