Beginnings of XML to OPAC conversion
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 25 Jan 2013 13:59:15 +0000 (14:59 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 25 Jan 2013 13:59:15 +0000 (14:59 +0100)
include/yaz/marcdisp.h
src/Makefile.am
src/xml_to_opac.c [new file with mode: 0644]
win/makefile

index 5fb0ea1..bd36fd1 100644 (file)
@@ -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);
 
 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
 /** \brief flushes records
     \param mt handle
     \param wr WRBUF for output
index 1c79893..2e7f700 100644 (file)
@@ -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 \
   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 \
   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 (file)
index 0000000..ab19cff
--- /dev/null
@@ -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 <config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <yaz/proto.h>
+#include <yaz/marcdisp.h>
+
+#if YAZ_HAVE_XML2
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+
+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
+ */
+
index f6f96d0..ec1ea46 100644 (file)
@@ -490,6 +490,7 @@ MISC_OBJS= \
    $(OBJDIR)\charneg.obj \
    $(OBJDIR)\grs1disp.obj \
    $(OBJDIR)\opac_to_xml.obj \
    $(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 \
    $(OBJDIR)\zgdu.obj \
    $(OBJDIR)\soap.obj \
    $(OBJDIR)\solr.obj \