1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2011 Index Data
3 * See the file LICENSE for details.
6 \brief Log XML / XSLT Errors via yaz_log
16 #include <yaz/snprintf.h>
19 #include <libxml/parser.h>
20 #include <libxml/tree.h>
23 #include <libxslt/xsltutils.h>
26 static int xml_error_log_level = YLOG_WARN;
29 static void xml_error_handler(void *ctx, const char *fmt, ...)
32 const char *prefix = (const char *) ctx;
37 yaz_vsnprintf(buf, sizeof(buf), fmt, ap);
38 yaz_log(xml_error_log_level, "%s: %s", prefix, buf);
44 void yaz_log_xml_errors(const char *prefix, int log_level)
46 xml_error_log_level = log_level;
49 xmlSetGenericErrorFunc((void *) (prefix ? prefix : "XML"),
52 xsltSetGenericErrorFunc((void *) (prefix ? prefix : "XSLT"),
61 * c-file-style: "Stroustrup"
62 * indent-tabs-mode: nil
64 * vim: shiftwidth=4 tabstop=8 expandtab