From 4b92c6833026a51cc391840d1157cd5fefede1df Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 25 Jan 2013 14:59:15 +0100 Subject: [PATCH] Beginnings of XML to OPAC conversion --- include/yaz/marcdisp.h | 12 ++++++++++++ src/Makefile.am | 3 ++- src/xml_to_opac.c | 39 +++++++++++++++++++++++++++++++++++++++ win/makefile | 1 + 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/xml_to_opac.c diff --git a/include/yaz/marcdisp.h b/include/yaz/marcdisp.h index 5fb0ea1..bd36fd1 100644 --- a/include/yaz/marcdisp.h +++ b/include/yaz/marcdisp.h @@ -438,6 +438,18 @@ YAZ_EXPORT void yaz_opac_decode_wrbuf(yaz_marc_t mt, Z_OPACRecord *r, YAZ_EXPORT void yaz_opac_decode_wrbuf2(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf, yaz_iconv_t cd); +#if YAZ_HAVE_XML2 +/** \brief Converts XML to OPAC + \param mt marc handle + \param src XML root node (presumably opacRecord node) + \param dst Z39.50 OPAC result - allocated by NMEM on marc handle + \param cd iconv handle for the OPAC content (not ISO2709 part) + + \*/ +YAZ_EXPORT void yaz_xml_to_opac(yaz_marc_t mt, xmlNode *src, + Z_OPACRecord **dst, yaz_iconv_t cd); +#endif + /** \brief flushes records \param mt handle \param wr WRBUF for output diff --git a/src/Makefile.am b/src/Makefile.am index 1c79893..2e7f700 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -92,7 +92,8 @@ libyaz_la_SOURCES=base64.c version.c options.c log.c \ zoom-event.c \ record_render.c zoom-socket.c zoom-opt.c zoom-p.h sru-p.h \ grs1disp.c zgdu.c soap.c srw.c srwutil.c uri.c solr.c diag_map.c \ - opac_to_xml.c cclfind.c ccltoken.c cclerrms.c cclqual.c cclptree.c cclp.h \ + opac_to_xml.c xml_to_opac.c \ + cclfind.c ccltoken.c cclerrms.c cclqual.c cclptree.c cclp.h \ cclqfile.c cclstr.c cclxmlconfig.c ccl_stop_words.c \ cql.y cqlstdio.c cqltransform.c cqlutil.c xcqlutil.c cqlstring.c \ cql_sortkeys.c cql2ccl.c rpn2cql.c \ diff --git a/src/xml_to_opac.c b/src/xml_to_opac.c new file mode 100644 index 0000000..ab19cff --- /dev/null +++ b/src/xml_to_opac.c @@ -0,0 +1,39 @@ +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2013 Index Data + * See the file LICENSE for details. + */ +/** + * \file xml_to_opac.c + * \brief Implements XML to OPAC conversion + */ +#if HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#include +#include + +#if YAZ_HAVE_XML2 +#include +#include + +void yaz_xml_to_opac(yaz_marc_t mt, xmlNode *src, Z_OPACRecord **dst, + yaz_iconv_t cd) +{ + +} +#endif + +/* + * Local variables: + * c-basic-offset: 4 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ + diff --git a/win/makefile b/win/makefile index f6f96d0..ec1ea46 100644 --- a/win/makefile +++ b/win/makefile @@ -490,6 +490,7 @@ MISC_OBJS= \ $(OBJDIR)\charneg.obj \ $(OBJDIR)\grs1disp.obj \ $(OBJDIR)\opac_to_xml.obj \ + $(OBJDIR)\xml_to_opac.obj \ $(OBJDIR)\zgdu.obj \ $(OBJDIR)\soap.obj \ $(OBJDIR)\solr.obj \ -- 1.7.10.4