From 80655e4b90bbe16ee3e3373ef310267cd5a651a3 Mon Sep 17 00:00:00 2001 From: "Sven-S. Porst" Date: Mon, 1 Oct 2012 18:10:44 +0200 Subject: [PATCH] add support for XInclude in the main configuration file --- src/pazpar2_config.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 92717e2..a4503b7 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +#include #include #include @@ -1232,7 +1233,10 @@ static int parse_config(struct conf_config *config, xmlNode *root) struct conf_config *config_create(const char *fname, int verbose) { - xmlDoc *doc = xmlParseFile(fname); + xmlDoc *doc = xmlReadFile(fname, + NULL, + XML_PARSE_XINCLUDE + XML_PARSE_NOBLANKS + + XML_PARSE_NSCLEAN + XML_PARSE_NONET ); xmlNode *n; const char *p; int r; @@ -1248,6 +1252,14 @@ struct conf_config *config_create(const char *fname, int verbose) return 0; } + // Perform XInclude. + r = xmlXIncludeProcess(doc); + if (r == -1) + { + yaz_log(YLOG_FATAL, "XInclude processing failed"); + return 0; + } + config->nmem = nmem; config->servers = 0; config->no_threads = 0; -- 1.7.10.4