Zebra links with ICU enabled YAZ. Requires YAZ 3.0.15 or later.
[idzebra-moved-to-github.git] / index / mod_dom.c
index 60cf180..4d8b02d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: mod_dom.c,v 1.37 2007-05-19 19:44:14 adam Exp $
+/* $Id: mod_dom.c,v 1.40 2007-10-21 19:39:00 adam Exp $
    Copyright (C) 1995-2007
    Index Data ApS
 
@@ -1119,7 +1119,8 @@ static int convert_extract_doc(struct filter_info *tinfo,
     else
         xmlDocDumpMemory(store_doc ? store_doc : doc, &buf_out, &len_out);
 
-    (*p->setStoreData)(p, buf_out, len_out);
+    if (p->setStoreData)
+        (*p->setStoreData)(p, buf_out, len_out);
     xmlFree(buf_out);
 
     if (store_doc)
@@ -1305,6 +1306,9 @@ static int filter_extract(void *clientData, struct recExtractCtrl *p)
         return RECCTRL_EXTRACT_ERROR_GENERIC;
     
     odr_reset(tinfo->odr_record);
+
+    if (p->setStoreData == 0)
+        return extract_xml_full(tinfo, input, p);
     switch(input->type)
     {
     case DOM_INPUT_XMLREADER:
@@ -1360,6 +1364,7 @@ static int filter_retrieve (void *clientData, struct recRetrieveCtrl *p)
     {
         p->diagnostic =
             YAZ_BIB1_SPECIFIED_ELEMENT_SET_NAME_NOT_VALID_FOR_SPECIFIED_;
+        p->addinfo = odr_strdup(p->odr, esn);
         return 0;
     }