[xml] retrive schema error.



Hi
A few days ago I posted question regarding how to retrive schema validation error.
I tried the call back function like this:
char errbuf[500];
void error_func(void *context, const char *format, ...)
{
  va_list arguments;
 
  va_start(arguments, format);
  vsprintf(errbuf, format, arguments);
  va_end(arguments);
}
 
 
and
 
 xmlSchemaSetValidErrors(ctxt, (xmlSchemaValidityErrorFunc)error_func,
                (xmlSchemaValidityWarningFunc)error_func, 0);
I just want to copy the error message into a global buffer. But I got segfault when running the test program if the validation failed.  I thought it wasthe problem caused by the last argument of xmlSchemaSetValidErrors
which is context, in my case what contex should I assign it to ? I tried stderr, stdout, and 0, none worked.
 
Thank you!
chris
 


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