From c5b012247779e809a4eaf1dc861dfb8a7cf5ae42 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 13 Aug 2007 12:12:30 +0000 Subject: [PATCH] Fixed bug #1348: Conversion into OPAC. The MARC conversion module was using Libxml2 to produce the bibliographicRecord and caused an XML header to be included in a bad place. --- src/logic.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/logic.c b/src/logic.c index e9fa969..2144acc 100644 --- a/src/logic.c +++ b/src/logic.c @@ -1,4 +1,4 @@ -/* $Id: logic.c,v 1.58 2007-07-30 23:16:33 quinn Exp $ +/* $Id: logic.c,v 1.59 2007-08-13 12:12:30 adam Exp $ Copyright (c) 2006-2007, Index Data. This file is part of Pazpar2. @@ -191,7 +191,18 @@ xmlDoc *record_to_xml(struct session_database *sdb, Z_External *rec) rdoc = xmlParseMemory((char*) wrbuf_buf(wrbuf_opac), wrbuf_len(wrbuf_opac)); if (!rdoc) + { yaz_log(YLOG_WARN, "Unable to parse OPAC XML"); + /* Was used to debug bug #1348 */ +#if 0 + FILE *f = fopen("/tmp/opac.xml.txt", "wb"); + if (f) + { + fwrite(wrbuf_buf(wrbuf_opac), 1, wrbuf_len(wrbuf_opac), f); + fclose(f); + } +#endif + } wrbuf_destroy(wrbuf_opac); } } @@ -223,7 +234,6 @@ xmlDoc *record_to_xml(struct session_database *sdb, Z_External *rec) return 0; } - yaz_marc_write_using_libxml2(sdb->yaz_marc, 1); if (yaz_marc_write_xml(sdb->yaz_marc, &res, "http://www.loc.gov/MARC21/slim", 0, 0) < 0) { -- 1.7.10.4