X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fmod_grs_xml.c;h=fda4010e02f8a44236a6c97d041216ebd612e2db;hb=022315e51f7179fc8ab9910d702e791685e62f1a;hp=248342b004aa50229a3f5c96adae210d21c4270d;hpb=b3679b1ecd730266f70a62347f66e5964a2fa030;p=idzebra-moved-to-github.git diff --git a/index/mod_grs_xml.c b/index/mod_grs_xml.c index 248342b..fda4010 100644 --- a/index/mod_grs_xml.c +++ b/index/mod_grs_xml.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1995-2008 Index Data + Copyright (C) 1994-2009 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 @@ -46,6 +46,14 @@ struct user_info { 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; @@ -199,11 +207,7 @@ static int cb_external_entity(XML_Parser pparser, 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); @@ -446,10 +450,7 @@ data1_node *zebra_read_xml(data1_handle dh, 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); @@ -540,6 +541,7 @@ idzebra_filter /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab