RE: [xml] Error handling with the XmlReader API
- From: "Stéphane Bidoul" <stephane bidoul softwareag com>
- To: <veillard redhat com>
- Cc: <xml gnome org>
- Subject: RE: [xml] Error handling with the XmlReader API
- Date: Tue, 14 Jan 2003 11:54:22 +0100
In .NET, that's easy, they have exceptions...
That could probably be emulated around the existing entry points.
Yes, at the python level.
What's your opinion on this?
Would you see a callback interface
or something like getLastError()?
Well the C reader implementation uses a parser context. the same
code for the general case can probably be reused nearly as-is except
for the freeing part. Or a completely different approach can
be attempted
(and exception would be fine).
Actually, I was first thinking of a way to expose an xmlreader error
handling API at the C level. Then I could add it at the python level.
Today, it's not possible, because the xmlParserCtxt is not exposed
(and even if it was, it would not be very clean to use it for that
purpose, IMHO).
How about?
typedef void (*xmlTextReaderErrorFunc)(xmlTextReaderPtr ctx, const char *msg);
int xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader, xmlTextReaderErrorFunc f)
Or?
const char *xmlTextReaderGetLastError(xmlTextReaderPtr reader);
void xmlTextReaderClearLastError(xmlTextReaderPtr reader);
-sbi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]