Re: [xml] Parsing error handling ?



1/. Redirecting the error funtion: Do you mean that I need to use xmlSetGenericErrorFunc ?
If so, I already did that, but I get a string message that I can't test.
What about the context ? Is it a way to provide an instance of an XML API
struct that can be used (initialized) by the parser or is it a way to
provide a user-defined struct that is passed in case of error ?

2/. Using a lower level api: I inspect the source code and I see that you
are using a SAX xml parser to do the job. Do you mean that I need to use a
SAX parser and check 'errNo' in the context object as you did in the code ?
Or do you think to something else ?

Thanx

Christophe Bourez

> On Fri, May 31, 2002 at 05:13:49PM +0200, chrisbee xml swing be wrote:
> > Hi,
> >
> > After parsing an XML file, I'd like to know why the parsing fails.
> > xmlParseFile() returns NULL in case of er! ror, but I'd like to receive
> > a more precise error code that I can test later. How can I do that ?
>
>   either redirrect the error funtion to your own routine
> or use a lower level api than xmlParseFile and look at the status in
> the parsing context.
>





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