#endif
#include <stdexcept>
-#include <boost/bind.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/tokenizer.hpp>
#if defined(XMLTOOLING_LOG4SHIB)
# include <log4shib/PropertyConfigurator.hh>
m_parserPool=new ParserPool();
m_validatingPool=new ParserPool(true,true);
- // Load catalogs from path.
- if (!catalog_path.empty()) {
- boost::tokenizer< char_separator<char> > catpaths(catalog_path, char_separator<char>(PATH_SEPARATOR_STR));
- for_each(
- catpaths.begin(), catpaths.end(),
- // Call loadCatalog with an inner call to s->c_str() on each entry.
- boost::bind(static_cast<bool (ParserPool::*)(const char*)>(&ParserPool::loadCatalog),
- m_validatingPool, boost::bind(&string::c_str,_1))
- );
- }
+ // Load catalogs from deprecated path setting.
+ if (!catalog_path.empty())
+ m_validatingPool->loadCatalogs(catalog_path.c_str());
// default registrations
XMLObjectBuilder::registerDefaultBuilder(new UnknownElementBuilder());
void setURLEncoder(URLEncoder* urlEncoder);
/**
+ * @deprecated
* List of catalog files to load into validating parser pool at initialization time.
* <p>Like other path settings, the separator depends on the platform
* (semicolon on Windows, colon otherwise).
#include <functional>
#include <boost/algorithm/string.hpp>
#include <boost/bind.hpp>
+#include <boost/tokenizer.hpp>
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLUniDefs.hpp>
#include <xercesc/sax/SAXException.hpp>
return true;
}
+bool ParserPool::loadCatalogs(const char* pathnames)
+{
+ boost::tokenizer< char_separator<char> > catpaths(string(pathnames), char_separator<char>(PATH_SEPARATOR_STR));
+ for_each(
+ catpaths.begin(), catpaths.end(),
+ // Call loadCatalog with an inner call to s->c_str() on each entry.
+ boost::bind(static_cast<bool (ParserPool::*)(const char*)>(&ParserPool::loadCatalog),
+ boost::ref(this), boost::bind(&string::c_str, _1))
+ );
+ return catpaths.begin() != catpaths.end();
+}
+
bool ParserPool::loadCatalog(const char* pathname)
{
auto_ptr_XMLCh temp(pathname);
xercesc::DOMDocument* parse(std::istream& is);
/**
+ * Load OASIS catalog files to map schema namespace URIs to filenames.
+ *
+ * <p>This does not provide real catalog support; only the <uri> element
+ * is supported to map from a namespace URI to a relative path or file:// URI.
+ *
+ * <p>Multiple files can be specified using a platform-specific path delimiter.
+ *
+ * @param pathname path to one or more catalog files
+ * @return true iff the catalogs were successfully processed
+ */
+ bool loadCatalogs(const char* pathnames);
+
+ /**
* Load an OASIS catalog file to map schema namespace URIs to filenames.
*
- * This does not provide real catalog support; only the <uri> element
+ * <p>This does not provide real catalog support; only the <uri> element
* is supported to map from a namespace URI to a relative path or file:// URI.
*
* @param pathname path to a catalog file
* @return true iff the catalog was successfully processed
*/
- bool loadCatalog(const char* pathname);
+ bool loadCatalog(const char* pathnames);
/**
* Load an OASIS catalog file to map schema namespace URIs to filenames.