Re: [xml] Handling of parser errors

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Tue Apr 25 2000 - 03:53:17 EDT


On Thu, Apr 20, 2000 at 12:09:52PM +0200, Georg C. F. Greve wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi!
>
> I'm currently worming my way into the libxml for a project and noticed
> something that is a little annoying. When the XML file contains
> errors these are printed directly on stdout/stderr - but for a program
> that does not have a stdout/stderr at the time when XML is being
> parsed this is highly undesireable. But I would still prefer not to
> use the SAX interface, if possible.

  It is possible to redirrect the messages without completely switching
to SAX, just override the error fatalError and warning routines of the
SAX data block with pointer to your own routines.
  There is an example in the xmllint.c program (where I convert the
messages to format them in HTML).
  I will add those examples to the main doc ...

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux XML libxml WWW
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
 http://www.w3.org/People/all#veillard%40w3.org  | RPM badminton Kaffe
----
Message from the list xml@xmlsoft.org
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@xmlsoft.org


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Aug 02 2000 - 12:30:11 EDT