struct _xmlError {
int domain : What part of the library raised this error
int code : The error code, e.g. an xmlParserError
char * message : human-readable informative error message
xmlErrorLevel level : how consequent is the error
char * file : the filename
int line : the line number if available
char * str1 : extra string information
char * str2 : extra string information
char * str3 : extra string information
int int1 : extra number information
int int2 : error column # or 0 if N/A (todo: rename field when we would brk ABI)
void * ctxt : the parser context if available
void * node : the node in the tree
} xmlError;
Function type xmlGenericErrorFunc
void xmlGenericErrorFunc (void * ctx,
const char * msg,
... ...)
Signature of the function to use when there is an error and no parsing or validity context available .
ctx: | a parsing context |
msg: | the message |
...: | the extra arguments of the varargs to format the message |
Function type xmlStructuredErrorFunc
void xmlStructuredErrorFunc (void * userData,
xmlErrorPtr error)
Signature of the function to use when there is an error and the module handles the new error reporting mechanism.
userData: | user provided data for the error callback |
error: | the error being raised. |
initGenericErrorDefaultFunc ()
void initGenericErrorDefaultFunc (xmlGenericErrorFunc * handler)
Set or reset (if NULL) the default handler for generic errors to the builtin error function.
xmlCopyError ()
int xmlCopyError (xmlErrorPtr from,
xmlErrorPtr to)
Save the original error to the new place.
from: | a source error |
to: | a target error |
Returns: | 0 in case of success and -1 in case of error. |
xmlCtxtGetLastError ()
xmlErrorPtr xmlCtxtGetLastError (void * ctx)
Get the last parsing error registered.
ctx: | an XML parser context |
Returns: | NULL if no error occurred or a pointer to the error |
xmlCtxtResetLastError ()
void xmlCtxtResetLastError (void * ctx)
Cleanup the last global error registered. For parsing error this does not change the well-formedness result.
ctx: | an XML parser context |
xmlGetLastError ()
xmlErrorPtr xmlGetLastError (void)
Get the last global error registered. This is per thread if compiled with thread support.
Returns: | NULL if no error occurred or a pointer to the error |
xmlParserError ()
void xmlParserError (void * ctx,
const char * msg,
... ...)
Display and format an error messages, gives file, line, position and extra parameters.
ctx: | an XML parser context |
msg: | the message to display/transmit |
...: | extra parameters for the message display |
xmlParserPrintFileContext ()
void xmlParserPrintFileContext (xmlParserInputPtr input)
Displays current context within the input content for error tracking
xmlParserPrintFileInfo ()
void xmlParserPrintFileInfo (xmlParserInputPtr input)
Displays the associated file and line information for the current input
xmlParserValidityError ()
void xmlParserValidityError (void * ctx,
const char * msg,
... ...)
Display and format an validity error messages, gives file, line, position and extra parameters.
ctx: | an XML parser context |
msg: | the message to display/transmit |
...: | extra parameters for the message display |
xmlParserValidityWarning ()
void xmlParserValidityWarning (void * ctx,
const char * msg,
... ...)
Display and format a validity warning messages, gives file, line, position and extra parameters.
ctx: | an XML parser context |
msg: | the message to display/transmit |
...: | extra parameters for the message display |
xmlParserWarning ()
void xmlParserWarning (void * ctx,
const char * msg,
... ...)
Display and format a warning messages, gives file, line, position and extra parameters.
ctx: | an XML parser context |
msg: | the message to display/transmit |
...: | extra parameters for the message display |
xmlResetError ()
void xmlResetError (xmlErrorPtr err)
Cleanup the error.
err: | pointer to the error. |
xmlResetLastError ()
void xmlResetLastError (void)
Cleanup the last global error registered. For parsing error this does not change the well-formedness result.
xmlSetGenericErrorFunc ()
void xmlSetGenericErrorFunc (void * ctx,
xmlGenericErrorFunc handler)
Function to reset the handler and the error context for out of context error messages. This simply means that @handler will be called for subsequent error messages while not parsing nor validating. And @ctx will be passed as first argument to @handler One can simply force messages to be emitted to another FILE * than stderr by setting @ctx to this file handle and @handler to NULL. For multi-threaded applications, this must be set separately for each thread.
ctx: | the new error handling context |
handler: | the new handler function |
xmlSetStructuredErrorFunc ()
void xmlSetStructuredErrorFunc (void * ctx,
xmlStructuredErrorFunc handler)
Function to reset the handler and the error context for out of context structured error messages. This simply means that @handler will be called for subsequent error messages while not parsing nor validating. And @ctx will be passed as first argument to @handler For multi-threaded applications, this must be set separately for each thread.
ctx: | the new error handling context |
handler: | the new handler function |