2 * Copyright (C) 2007, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: libxml2_error.c,v 1.4 2007-02-23 10:15:01 adam Exp $
8 * \file libxml2_error.c
9 * \brief Libxml2 error handling
15 #include <yaz/snprintf.h>
16 #include <yaz/libxml2_error.h>
19 #include <libxml/xmlerror.h>
23 #include <libxslt/xsltutils.h>
26 static int libxml2_error_level = 0;
28 static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
35 yaz_vsnprintf(buf, sizeof(buf)-1, fmt, ap);
36 yaz_log(libxml2_error_level, "%s: %s", (char*) ctx, buf);
41 int libxml2_error_to_yazlog(int level, const char *lead_msg)
43 libxml2_error_level = level;
45 xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
48 xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
58 * indent-tabs-mode: nil
60 * vim: shiftwidth=4 tabstop=8 expandtab