[xml] API for reporting parse and other errors



hi there,

looking into the libxml2 API I find some
basic mechanism to let applications deal
with parsing and other errors.
This API is stream based, i.e. a function
is invoked with the signature

void error(void *context, char *format, ...)

where the ellipsis contains the actual message.

It seems the only way to find out about the message
is to actually write it out (using the *printf
family of functions), and then go ahead with that
message.

How do the error messages map to logical error
types ?

Example: I'd like to provide a more 'typed' API
in my C++ wrapper, (for example) providing an
'xpath_syntax_error'. To be able to detect that
a given error is indeed an incorrect xpath string,
I have to parse the message. Is the set of all
possible error messages documented somewhere ?

Even better: are there plans to enhance the error
reporting API in this direction ? (this may be
done on top of the existing API, though I suspect
it would be more efficient to replace it, as the
whole encoding/decoding business could be avoided).

Best regards,
                Stefan




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