-/* $Id: mod_dom.c,v 1.36 2007-04-16 21:54:37 adam Exp $
+/* $Id: mod_dom.c,v 1.42 2007-12-13 19:59:21 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
{
xmlChar *text = xmlNodeGetContent(node);
size_t text_len = strlen((const char *)text);
-
+
/* if there is no text, we do not need to proceed */
if (text_len)
{
}
/* actually indexing the text given */
- dom_log(YLOG_DEBUG, tinfo, 0,
- "INDEX '%s:%s' '%s'",
- index ? (const char *) index : "null",
- type ? (const char *) type : "null",
- text ? (const char *) text : "null");
recword->index_name = (const char *)index;
if (type && *type)
- recword->index_type = *type;
+ recword->index_type = (const char *) type;
/* writing debug out */
if (extctr->flagShowRecords)
type ? (const char *) type : "null",
text ? (const char *) text : "null");
- /* actually indexing the text given */
- recword->index_name = (const char *)index;
- if (type && *type)
- recword->index_type = *type;
(extctr->tokenAdd)(recword);
/* eat whitespaces */
else
dom_log(YLOG_WARN, tinfo, node, "bad @type value: %s", type_p);
extctr->action = action;
- yaz_log(YLOG_LOG, "In mod_dom.c: setting action to %d", action);
}
if (tinfo->record_info_invoked == 1)
params[0] = 0;
set_param_str(params, "schema", zebra_dom_ns, tinfo->odr_record);
+ if (p && p->flagShowRecords)
+ {
+ xmlChar *buf_out;
+ int len_out;
+#if 0
+ FILE *outf = fopen("extract.xml", "w");
+ xmlDocDumpMemory(doc, &buf_out, &len_out);
+ fwrite(buf_out, 1, len_out, outf);
+#endif
+ yaz_log(YLOG_LOG, "Extract Doc: %.*s", len_out, buf_out);
+#if 0
+ fclose(outf);
+#endif
+ }
+
/* input conversion */
perform_convert(tinfo, p, input->convert, params, &doc, 0);
+
if (tinfo->store)
{
/* store conversion */
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)
{
xmlDocPtr rdoc;
xmlNode *root_ptr;
- yaz_marc_write_xml(input->u.marc.handle, &root_ptr, 0, 0, 0);
+ yaz_marc_write_xml(input->u.marc.handle, &root_ptr,
+ "http://www.loc.gov/MARC21/slim", 0, 0);
rdoc = xmlNewDoc((const xmlChar*) "1.0");
xmlDocSetRootElement(rdoc, root_ptr);
return convert_extract_doc(tinfo, input, p, rdoc);
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:
{
p->diagnostic =
YAZ_BIB1_SPECIFIED_ELEMENT_SET_NAME_NOT_VALID_FOR_SPECIFIED_;
+ p->addinfo = odr_strdup(p->odr, esn);
return 0;
}