Re: [xml] xmlValidityErrorFunc how-to?

On Mon, Oct 06, 2003 at 02:17:13PM +0200, Petr Novak wrote:
Hi all,
can you advise me where to find some description about xmlValidityErrorFunc?
There is ValidCtxt->warning = (xmlValidityErrorFunc) fprintf; in the xmllint.c
but I need to call my own function if warning or error is occured.

In documentation is only that the prototype of xmlValidityErrorFunc is
(*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
I can obtain error message in char* format, but I need validation context,
because I need to know in whitch element the error was occured.

So if I wrote the follow function it doesn't work:

void test(xmlValidCtxtPtr ctx, const char *msg, void *el){
  cout << ctx->node->name;

Can you advise me?

  Look at the code in error.c implementing xmlParserValidityError()
that will give you an idea of what you can do.


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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