X-Git-Url: http://git.indexdata.com/?p=mp-sparql-moved-to-github.git;a=blobdiff_plain;f=src%2Ffilter_sparql.cpp;fp=src%2Ffilter_sparql.cpp;h=11206a74da3803da0fc3743c5249b82770dc50b2;hp=f168571b9886f85a748a7f7d6833e4ef66801c37;hb=dd9e60bc906fcd3dffd764d079aa77cfede70f07;hpb=a0884c6c35bc62160b6ce6100a4e8ad2d15ab937 diff --git a/src/filter_sparql.cpp b/src/filter_sparql.cpp index f168571..11206a7 100644 --- a/src/filter_sparql.cpp +++ b/src/filter_sparql.cpp @@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include #include +#include #include "sparql.h" #include @@ -179,21 +180,29 @@ void yf::SPARQL::configure(const xmlNode *xmlnode, bool test_only, conf->schema = mp::xml::get_text(attr->children); else if (!strcmp((const char *) attr->name, "include")) { - std::string name = mp::xml::get_text(attr->children); - std::list::const_iterator it = db_conf.begin(); - while (1) - if (it == db_conf.end()) - { - throw mp::filter::FilterException( - "include db not found: " + name); - } - else if (name.compare((*it)->db) == 0) - { - yaz_sparql_include(s, (*it)->s); - break; - } - else - it++; + std::vector dbs; + std::string db = mp::xml::get_text(attr->children); + boost::split(dbs, db, boost::is_any_of(" \t")); + size_t i; + for (i = 0; i < dbs.size(); i++) + { + if (dbs[i].length() == 0) + continue; + std::list::const_iterator it = db_conf.begin(); + while (1) + if (it == db_conf.end()) + { + throw mp::filter::FilterException( + "include db not found: " + dbs[i]); + } + else if (dbs[i].compare((*it)->db) == 0) + { + yaz_sparql_include(s, (*it)->s); + break; + } + else + it++; + } } else throw mp::filter::FilterException(