Re: [PHP-XML-DEV] xml error handling for 5.1

[email protected] (Rob Richards) Fri, 04 Feb 2005 08:01:42 -0500
Newsgroups php.xml.dev
Message-ID <[email protected]>
Christian Stocker wrote:

> Looks good to me and it's more or less one of the ways I had in mind.
>
> I think it's a plain and simple approach. Some people wanted 
> exceptions for that, but IMHO it's not necessery and would force you 
> to try/catch even for simple warnings.

Yup, and in any event they can use the error object to throw their own 
exception. Take the case of the request for better error handling using 
schemas. They will first get the exception thrown from dom and at that 
point, if they want they can throw their own exception or handle the 
error any way they please with the information from the error object.

> I would have preferred the callback approach, but I see the problems 
> you had with that. I can live very well with this implementation. And 
> I prefer it anyway over memleak hunting ;)

If you really want to play with the callback approach, let me know as I 
still have the code. I spent most time trying to get that to work, but I 
just could not figure out any way to resolve the memory leak issues it had.

> I will do some tests (hopefully over the weekend) and report back 

Thanks,

Rob