From b33db4435e63a69fc8aafa1e3a163743b79b6990 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 9 Nov 2004 14:24:22 +0000 Subject: [PATCH] Implement XInclude for XML configuration file(s). --- NEWS | 2 ++ etc/Makefile.am | 3 ++- etc/config.xml | 11 +++-------- etc/explain.xml | 11 +++++++++++ src/yaz-proxy-config.cpp | 7 ++++++- 5 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 etc/explain.xml diff --git a/NEWS b/NEWS index d1e2c3d..a637fac 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +Implement XInclude for configuration file(s). + Fixed bug #189: Bad authenticated session transfer. New config element "authentication" which specifies authentication diff --git a/etc/Makefile.am b/etc/Makefile.am index 4aba48b..7904c47 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.3 2004-04-23 16:10:24 adam Exp $ +# $Id: Makefile.am,v 1.4 2004-11-09 14:24:22 adam Exp $ proxydatadir=$(datadir)/yazproxy proxydata_DATA = \ @@ -9,6 +9,7 @@ proxydata_DATA = \ MARC21slim2RDFDC.xsl \ MARC21slimUtils.xsl \ config.xml \ + explain.xml \ voyager.xml \ pqf.properties \ yazproxy.xsd \ diff --git a/etc/config.xml b/etc/config.xml index 6bc751c..da92156 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -1,6 +1,7 @@ - + @@ -26,13 +27,7 @@ 0 - - - localhost - 9000 - gils - - + pqf.properties adam/x diff --git a/etc/explain.xml b/etc/explain.xml new file mode 100644 index 0000000..4db3c6b --- /dev/null +++ b/etc/explain.xml @@ -0,0 +1,11 @@ + + + localhost + 9000 + gils + + + My Database + My database description + + diff --git a/src/yaz-proxy-config.cpp b/src/yaz-proxy-config.cpp index 0486e73..c05724e 100644 --- a/src/yaz-proxy-config.cpp +++ b/src/yaz-proxy-config.cpp @@ -1,4 +1,4 @@ -/* $Id: yaz-proxy-config.cpp,v 1.8 2004-10-23 23:12:24 adam Exp $ +/* $Id: yaz-proxy-config.cpp,v 1.9 2004-11-09 14:24:22 adam Exp $ Copyright (c) 1998-2004, Index Data. This file is part of the yaz-proxy. @@ -26,6 +26,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #if HAVE_XSLT #include #include +#include #include #include #endif @@ -95,6 +96,10 @@ int Yaz_ProxyConfig::read_xml(const char *fname) yaz_log(LOG_WARN, "Config file %s not found or parse error", fname); return -1; // no good } + int noSubstitutions = xmlXIncludeProcess(ndoc); + if (noSubstitutions == -1) + yaz_log(LOG_WARN, "XInclude processing failed on config %s", fname); + xmlNodePtr proxyPtr = xmlDocGetRootElement(ndoc); if (!proxyPtr || proxyPtr->type != XML_ELEMENT_NODE || strcmp((const char *) proxyPtr->name, "proxy")) -- 1.7.10.4