Re: [xml] Linx number available via SAX interface?

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Thu Jul 27 2000 - 20:45:12 EDT


On Thu, Jul 27, 2000 at 05:26:26PM -0700, Shane Adams wrote:
>
> Hmmm I wonder if I'm doing something fundamentally
> wrong. The passed in ctx pointer (void *) I use as my
> "internal" data structure. Now in error.c, the
> xmlParserError handler seems to cast it to a different
> object. Should I really be doing something like this
> in my callbacks? (Ignoring the line # problem for a
> minute)

 The informations are extracted from the parser
context (more precisely the pointer to the current entity
being processed ctxt->input). If you use your own
"internal" data structure then:
  1/ you better know what you are doing
  2/ you need to write your own error/warning handling routines
     Check xmlParserPrintFileInfo and xmlParserError for
     the standard code doing this. Those routines should
     replace the error/warning/fatalError in the SAX callback
     set.
  3/ you should save the xmlParserCtxtPtr in use in the
     "internal" structure if you want to recover the extra
     line and context informations.
 
 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:24 EDT