/* This file is part of the Zebra server.
- Copyright (C) 1995-2008 Index Data
+ Copyright (C) 1994-2011 Index Data
Zebra is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
*/
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
#if HAVE_EXPAT_H
#include <assert.h>
int loglevel;
};
+static void report_xml_error(XML_Parser parser)
+{
+ zint line = XML_GetCurrentLineNumber(parser);
+ zint col = XML_GetCurrentColumnNumber(parser);
+ yaz_log (YLOG_WARN, ZINT_FORMAT ":" ZINT_FORMAT ":XML error: %s",
+ line, col, XML_ErrorString(XML_GetErrorCode(parser)));
+}
+
static void cb_start (void *user, const char *el, const char **attr)
{
struct user_info *ui = (struct user_info*) user;
if (!XML_ParseBuffer (parser, r, done))
{
done = 1;
- yaz_log (YLOG_WARN, "%s:%d:%d:XML error: %s",
- systemId,
- XML_GetCurrentLineNumber(parser),
- XML_GetCurrentColumnNumber(parser),
- XML_ErrorString(XML_GetErrorCode(parser)));
+ report_xml_error(parser);
}
}
fclose (inf);
if (no_read && !XML_ParseBuffer (parser, r, done))
{
done = 1;
- yaz_log (YLOG_WARN, "%d:%d:XML error: %s",
- XML_GetCurrentLineNumber(parser),
- XML_GetCurrentColumnNumber(parser),
- XML_ErrorString(XML_GetErrorCode(parser)));
+ report_xml_error(parser);
}
}
XML_ParserFree (parser);
};
RecType
-#ifdef IDZEBRA_STATIC_GRS_XML
+#if IDZEBRA_STATIC_GRS_XML
idzebra_filter_grs_xml
#else
idzebra_filter
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab