X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpazpar2_config.c;h=b375b389a9de64b7e9593f10f48f6312b3990c12;hb=8979547d2f3be2c18f640f3569bd14e778d54de1;hp=60f1585516608521fc9d814582432e8cb859a27a;hpb=9b836e74ec3520f3c60b20515bab10940d4c6897;p=pazpar2-moved-to-github.git diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 60f1585..b375b38 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -1,5 +1,5 @@ /* 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 @@ -409,9 +409,19 @@ static int parse_metadata(struct conf_service *service, xmlNode *n, 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; + } } @@ -430,6 +440,7 @@ static int parse_metadata(struct conf_service *service, xmlNode *n, xmlFree(xml_termlist); xmlFree(xml_rank); xmlFree(xml_setting); + xmlFree(xml_mergekey); (*md_node)++; return 0; } @@ -1060,7 +1071,11 @@ struct conf_config *config_create(const char *fname, int verbose) { 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); }