Re: [xml] Error handling with the XmlReader API



On Sat, Jan 18, 2003 at 10:43:20PM +0100, Stéphane Bidoul wrote:
I'm polishing the error handling interface a little bit...

I think that providing locator information as an opaque
type would help future-proofing the API (in case we want
to provide additional error context in the future). 

I'm planning to do something like this:

typedef void *xmlTextReaderLocatorPtr;
typedef void (*xmlTextReaderErrorFunc)(void *arg, 
                                                 const char *msg,
                                                 xmlParserSeverities severity,
                                                 xmlTextReaderLocatorPtr locator);
int             xmlTextReaderLocatorGetLine     (xmlTextReaderLocatorPtr locator);
int             xmlTextReaderLocatorGetCol      (xmlTextReaderLocatorPtr locator);
const char *    xmlTextReaderLocatorGetSystemId (xmlTextReaderLocatorPtr locator);

The lifetime of the locator would be the duration of the callback,
of course.

Is this ok for you?

  Yep, I assume you tried to match the names of the accessors for the
Locators with those at the xmlTextReader level (can't remember I switched
work to something else, the reader is a bit out of context ATM).

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]