By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,442 Members | 1,580 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,442 IT Pros & Developers. It's quick & easy.

DOMExceptions not thrown when I expect them to

P: n/a
When I execute the folowing in PHP5

<?php
*$xml*=*<<<XML
<page>
*<test>Dit*is*een*test<test>
</page>
XML;
*
*$dom*=*new*DomDocument();
*try*{*
**$dom->loadXML(*$xml*);
*}*catch(*DOMException*$e*)*{*
**print*$e;*
*}
?>

I only get error messages, no DOMExceptions. The documentation of the DOM
package on Zend says:
The API of the module follows the DOM Level 2 standard as closely as
possible. Consequently, the API is fully object-oriented. It is a good idea
to have the DOM standard available when using this module.

Followed by a list of possible DOMExceptions and their codes.

My question is, how can I detect XML errors in the document loaded by
$dom->load() without using the PHP error reporting ( set_error_handler(),
set_error_level(), trigger_error()... )

Thanks in advance
*Rutger
--
Rutger Claes ru**********@tiscali.tld
Replace tld with top level domain of belgium to contact me pgp:0x3B7D6BD6
In the next world, you're on your own.
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.