Handling errors: DOMError, DOMObject, DOMLocator

Rob Buis rwlbuis at xs4all.nl
Sun Feb 20 20:14:15 GMT 2005


Hi Frans,

On Sun, Feb 20, 2005 at 06:29:56PM +0000, Frans Englich wrote:
> 
> Hello,
> 
> Many XML applications needs to do error reporting with the physical file as 
> background. E.g, they reach a certain point and need to report something that 
> was wrong on a certain line.
> 
> DOMError and DOMLocator exists, and after having read the DOM 3 core spec, I 
> still don't understand how I should use them. When I've found an error, how 
> do I create a DOMError, and how do I "pass it on" to the host code(somehow 
> the DOMImplementation since it should test it against DOMErrorHandler)?

Well, the configuration in the document seems to store the current
error handler. So you can override that to get to your host code.
 
> I'm also wondering about the DOMObject member of DOMError, which currently is 
> commented out. AFAICT, the DOMObject is supposed to be a base class which 
> data specific to the DOMError object is cast to. How is this supposed to be 
> solved? Should all classes inherit from DOMObject? :)

I am not sure about that one. Seems like a void * kind of thing, or
a generic placeholder. We'll probably find out how to represent them
when we know why they are used/need them :)

> In short: how do one do error reporting?

Have a look at my commit introducing DOMErrorHandler.
To make it possible from user code, maybe I'll implement 
DOMConfiguration soon...
Cheers,

Rob.




More information about the kfm-devel mailing list