1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 Index Data
3 * See the file LICENSE for details.
6 * \file libxml2_error.c
7 * \brief Libxml2 error handling
13 #include <yaz/snprintf.h>
14 #include <yaz/libxml2_error.h>
17 #include <libxml/xmlerror.h>
21 #include <libxslt/xsltutils.h>
24 static int libxml2_error_level = 0;
26 static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
33 yaz_vsnprintf(buf, sizeof(buf)-1, fmt, ap);
34 yaz_log(libxml2_error_level, "%s: %s", (char*) ctx, buf);
39 int libxml2_error_to_yazlog(int level, const char *lead_msg)
41 libxml2_error_level = level;
43 xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
46 xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
56 * indent-tabs-mode: nil
58 * vim: shiftwidth=4 tabstop=8 expandtab