projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b00c405
)
add support for XInclude in the main configuration file
author
Sven-S. Porst
<porst@sub.uni-goettingen.de>
Mon, 1 Oct 2012 16:10:44 +0000
(18:10 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 3 Feb 2014 12:56:42 +0000
(13:56 +0100)
src/pazpar2_config.c
patch
|
blob
|
history
diff --git
a/src/pazpar2_config.c
b/src/pazpar2_config.c
index
92717e2
..
a4503b7
100644
(file)
--- 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 <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
+#include <libxml/xinclude.h>
#include <yaz/yaz-util.h>
#include <yaz/nmem.h>
#include <yaz/yaz-util.h>
#include <yaz/nmem.h>
@@
-1232,7
+1233,10
@@
static int parse_config(struct conf_config *config, xmlNode *root)
struct conf_config *config_create(const char *fname, int verbose)
{
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;
xmlNode *n;
const char *p;
int r;
@@
-1248,6
+1252,14
@@
struct conf_config *config_create(const char *fname, int verbose)
return 0;
}
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;
config->nmem = nmem;
config->servers = 0;
config->no_threads = 0;