[xml] redirecting errors


I tried using xmlSetGenericErrorFunc as is stated in the online documentation
to redirect the errors encountered to a file (i.e it says One can simply force
messages to be emitted to another FILE * than stderr by setting ctx to this
file handle and handler to NULL.).

However, I am getting an:

"unhandled exception in myfile.exe (ntdll.dll): access violation".

Here is a snipit my code that I am using. Can you help please.

xmlParserCtxtPtr ctxt;
FILE* x;

x = fopen("errors.txt", "w");
xmlDoValidityCheckingDefaultValue = 1;
ctxt = xmlCreateFileParserCtxt(XMLFile);
xmlSetGenericErrorFunc(x, NULL);

Michael Picheca, pichecma mcmaster ca on 12/13/2001

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