[xml] Hooked error handler being called twice ?!?!

Hello folks:

        I've been searching archives but didn't find any clue.
I'm setting a new error handler which is called twice. I think I'm messing things up in some detail, but...
        The code (of course I'm including "libxml/xmlerrors.h") :

void errorHandler(void *, char *, ...);

  xmlDocPtr xmlconfigfile;
  xmlNodePtr node;
  xmlNodePtr rootnode;

  xmlSetGenericErrorFunc(NULL, (xmlGenericErrorFunc) errorHandler);

<some others functions here>

errorHandler(void *c, char *s, ...)
  printf("Error handler!\n");


When I run it:
[lucas dirc60 beta-server]$ ./betad -c noconfig.xml
Error handler!
Error handler!

"noconfig.xml" is a non-existent configuration file which I call
xmlParseFile() to parse it. Normally this last one show me a
warning message "warning: failed to load external entity "noconfig.xml""

Any help ? Thanks in advance.

Bests regards


Lucas Brasilino
brasilino recife pe gov br
Emprel -        Empresa Municipal de Informatica (pt_BR)
                Municipal Computing Enterprise (en_US)
Recife - Pernambuco - Brasil
Fone: +55-81-34167078

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