ID:               48512
 Updated by:       il...@php.net
 Reported By:      k...@php.net
-Status:           Open
+Status:           Assigned
 Bug Type:         DOM XML related
 Operating System: Mac OS X 10.5.7
 PHP Version:      5.3CVS-2009-06-09 (CVS)
-Assigned To:      
+Assigned To:      iliaa


Previous Comments:
------------------------------------------------------------------------

[2009-06-09 18:25:58] k...@php.net

Description:
------------
The TestFest seems to be working :) Just found a strange behavior in
DOMDocument::validate(). If no DTD is given you'll both have a E_NOTICE
and a E_WARN saying pretty much the same. Looking at the implementation
it seems like PHP tries to define this behavior as a E_NOTICE, while it
will fail in libxml as a E_WARN.

I would expect this method to raise just one of the error messages, not
both.

The E_NOTICE is raised in line 1941 in ext/dom/document.c


Reproduce code:
---------------
<?php
$xml = "<?xml version=\"1.0\"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend</body>
</note>";
$dom = new DOMDocument('1.0');
$dom->loadXML($xml);
var_dump($dom->validate());
?>

Expected result:
----------------
Warning: DOMDocument::validate(): no DTD found! in %s on line 11

Actual result:
--------------
Notice: DOMDocument::validate(): No DTD given in XML-Document in %s on
line 11

Warning: DOMDocument::validate(): no DTD found! in %s on line 11



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48512&edit=1

Reply via email to