/* This file is part of Pazpar2.
- Copyright (C) 2006-2009 Index Data
+ Copyright (C) 2006-2010 Index Data
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
#include <libxml/parser.h>
#include <libxml/tree.h>
-#include <libxslt/xslt.h>
-#include <libxslt/transform.h>
-#include <libxslt/xsltutils.h>
#include <yaz/yaz-util.h>
#include <yaz/nmem.h>
else
sortkey_offset = -1;
- if (xml_mergekey && strcmp((const char *) xml_mergekey, "no"))
+ if (xml_mergekey)
{
- mergekey_type = Metadata_mergekey_yes;
+ if (!strcmp((const char *) xml_mergekey, "required"))
+ mergekey_type = Metadata_mergekey_required;
+ else if (!strcmp((const char *) xml_mergekey, "optional"))
+ mergekey_type = Metadata_mergekey_optional;
+ else if (!strcmp((const char *) xml_mergekey, "no"))
+ mergekey_type = Metadata_mergekey_no;
+ else
+ {
+ yaz_log(YLOG_FATAL, "Unknown value for mergekey: %s", xml_mergekey);
+ return -1;
+ }
}
xmlFree(xml_termlist);
xmlFree(xml_rank);
xmlFree(xml_setting);
+ xmlFree(xml_mergekey);
(*md_node)++;
return 0;
}
}
else if (!(*sp)->id && !service_id)
{
- yaz_log(YLOG_FATAL, "Duplicate unnamed service '%s'",
- service_id);
+ yaz_log(YLOG_FATAL, "Duplicate unnamed service");
break;
}
return server;
}
-xsltStylesheet *conf_load_stylesheet(struct conf_service *service,
- const char *fname)
+WRBUF conf_get_fname(struct conf_service *service, const char *fname)
{
struct conf_config *config = service->server->config;
WRBUF w = wrbuf_alloc();
- xsltStylesheet *s;
conf_dir_path(config, w, fname);
- s = xsltParseStylesheetFile((xmlChar *) wrbuf_cstr(w));
- wrbuf_destroy(w);
- return s;
+ return w;
}
static struct conf_targetprofiles *parse_targetprofiles(NMEM nmem,
{
yaz_log(YLOG_LOG, "Configuration %s after include processing",
fname);
+#if LIBXML_VERSION >= 20600
xmlDocFormatDump(yaz_log_file(), doc, 0);
+#else
+ xmlDocDump(yaz_log_file(), doc);
+#endif
}
r = parse_config(config, n);
}