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

Date view Thread view Subject view Author view

From: Shane Adams (adamsch1@yahoo.com)
Date: Thu Jul 27 2000 - 20:26:26 EDT


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)

void errorDebug( void *ctx, const char *msg, ... ) {

xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input = ctxt->input;
mydata *foo = ctxt->user_data;

/* Error handling specifics below */
...
}

What I'm doing now is simply:

void errorDebug(void *ctx, const char *msg, ... ) {
  mydata *foo = (mydata *)ctx;

  /* Error handlign specifics below */
...
}

--- Daniel Veillard <Daniel.Veillard@w3.org> wrote:
>
> On Thu, Jul 27, 2000 at 03:48:39PM -0700, Shane
> Adams wrote:
> >
> > Hi, I'm trying to get more information out of the
> > default error handler (in error.c). The error
> handler
> > indicates that the line number will be included,
> but
> > it doesn't appear in the output. Anything I'm
> > missing?
>
> Well usually it does:
> ~/XML -> ./xmllint tst2.xml
> tst2.xml:1: error: Opening and ending tag
> mismatch: doc and doh
> <doc></doh>
> ^
>
> So I don't know what's the problem. Just put a
> breakpoint in the given
> routine with a debugger and trace what's happening !
>
> 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

__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

----
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