Re: [xml] Push mode - error checking



On Tue, Nov 06, 2001 at 06:59:12PM +0100, Heiko W. Rupp wrote:
can I when using the parser push mode with xmlParseChunk()
get parser errors before the entire file is read?
I am using the example at http://xmlsoft.org/library.html
and I only get an error, when the entire input is read.

[..]
  Hum, the parser will raise an error when it finds it.
You can check the status of the parser from the context passed
to xmlParseChunk(), ctxt->wellFormed should stay to 1.
If not a fatal error was raised, 

Thanks, got it now.

Would it make sense to change the above example to something
more like the attached to show how this works (and prevent 
questions like mine in the future)?

  Well in general when people have errors in XML files they might
be interested in knowing about it. It's the default behaviour, 
also note that the default behaviour logs the error messages.
The progressive parser is not different in this respect than the
non-progressive one. The errors are logged as they are found, not
batched until the end of the resource is detected.
  
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]