#45727 [Opn->Bgs]: DOMDocument::load() is not reporting errors on malformed XML

From: Date: Wed, 06 Aug 2008 05:33:49 +0000
Subject: #45727 [Opn->Bgs]: DOMDocument::load() is not reporting errors on malformed XML
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127651@lists.php.net to get a copy of this message
ID: 45727 Updated by: chregu@php.net Reported By: mephtu at yahoo dot com -Status: Open +Status: Bogus Bug Type: DOM XML related Operating System: Linux PHP Version: 5.2.6 New Comment: I get "Warning: DOMDocument::load(): Opening and ending tag mismatch: tags line 1 and ags in /Users/chregu/tmp/foo.xml, line: 1 in /Users/chregu/tmp/foo.php on line 3" what is to be expected. Do you have set the error level correctly? Does it really die after load? The script shouldn't stop there. and maybe http://ch2.php.net/manual/en/function.libxml-use-internal- errors.php is of help for you Previous Comments: ------------------------------------------------------------------------ [2008-08-05 15:04:44] mephtu at yahoo dot com Description: ------------ Loading a malformed XML document with DOMDocument::load() fails to report any errors. Reproduce code: --------------- load.php: <?php $dom = new DOMDocument(); $dom->load('malformed.xml'); ?> malformed.xml: <tags>data</ags> Expected result: ---------------- I expected to see an error message. Actual result: -------------- Parser dies silently without reporting error. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45727&edit=1

« previous php.bugs (#127651) next »