diff --git a/Util/include/Poco/Util/XMLConfiguration.h b/Util/include/Poco/Util/XMLConfiguration.h index 539e44df1..43721015d 100644 --- a/Util/include/Poco/Util/XMLConfiguration.h +++ b/Util/include/Poco/Util/XMLConfiguration.h @@ -134,6 +134,12 @@ public: /// Loads the XML document containing the configuration data /// from the given InputSource. + void load(Poco::XML::InputSource* pInputSource, unsigned long namePoolSize); + /// Loads the XML document containing the configuration data + /// from the given InputSource. Uses the give namePoolSize (which + /// should be a suitable prime like 251, 509, 1021, 4093) for the + /// internal DOM Document's name pool. + void load(std::istream& istr); /// Loads the XML document containing the configuration data /// from the given stream. diff --git a/Util/src/XMLConfiguration.cpp b/Util/src/XMLConfiguration.cpp index 9bdbe5a90..e9249f09e 100644 --- a/Util/src/XMLConfiguration.cpp +++ b/Util/src/XMLConfiguration.cpp @@ -123,11 +123,11 @@ XMLConfiguration::~XMLConfiguration() } -void XMLConfiguration::load(Poco::XML::InputSource* pInputSource) +void XMLConfiguration::load(Poco::XML::InputSource* pInputSource, unsigned long namePoolSize) { poco_check_ptr (pInputSource); - Poco::XML::DOMParser parser; + Poco::XML::DOMParser parser(namePoolSize); parser.setFeature(Poco::XML::XMLReader::FEATURE_NAMESPACES, false); parser.setFeature(Poco::XML::DOMParser::FEATURE_FILTER_WHITESPACE, true); Poco::XML::AutoPtr pDoc = parser.parse(pInputSource); @@ -135,6 +135,12 @@ void XMLConfiguration::load(Poco::XML::InputSource* pInputSource) } +void XMLConfiguration::load(Poco::XML::InputSource* pInputSource) +{ + load(pInputSource, POCO_XML_NAMEPOOL_DEFAULT_SIZE); +} + + void XMLConfiguration::load(std::istream& istr) { Poco::XML::InputSource src(istr);