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

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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