2 * Copyright (C) 2006, Index Data ApS
3 * See the file LICENSE for details.
5 * $Id: libxml2_error.c,v 1.2 2006-07-06 10:17:53 adam Exp $
8 * \file libxml2_error.c
9 * \brief Libxml2 error handling
15 #include <yaz/libxml2_error.h>
18 #include <libxml/xmlerror.h>
22 #include <libxslt/xsltutils.h>
25 static int libxml2_error_level = 0;
27 static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
35 vsprintf(buf, fmt, ap);
37 vsnprintf(buf, sizeof(buf), fmt, ap);
39 yaz_log(libxml2_error_level, "%s: %s", (char*) ctx, buf);
44 int libxml2_error_to_yazlog(int level, const char *lead_msg)
46 libxml2_error_level = level;
48 xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler);
51 xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler);
61 * indent-tabs-mode: nil
63 * vim: shiftwidth=4 tabstop=8 expandtab