1 /* $Id: p2_xmlerror.cpp,v 1.2 2005-10-08 23:29:32 adam Exp $
2 Copyright (c) 1998-2005, Index Data.
4 This file is part of the yaz-proxy.
6 YAZ proxy is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
11 YAZ proxy is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with YAZ proxy; see the file LICENSE. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
27 #include "p2_xmlerror.h"
30 #include <libxml/parser.h>
31 #include <libxslt/xsltutils.h>
35 static void p2_xml_error_handler(void *ctx, const char *fmt, ...)
44 vsprintf(buf, fmt, ap);
46 vsnprintf(buf, sizeof(buf), fmt, ap);
49 if (sz > 0 && buf[sz-1] == '\n')
52 yaz_log(YLOG_WARN, "%s: %s", (char*) ctx, buf);
58 void p2_xmlerror_setup()
61 xmlSetGenericErrorFunc((void *) "XML", p2_xml_error_handler);
62 xsltSetGenericErrorFunc((void *) "XSLT", p2_xml_error_handler);
68 * indent-tabs-mode: nil
70 * vim: shiftwidth=4 tabstop=8 expandtab