- map<xstring,xstring>::const_iterator i=m_schemaLocMap.find(systemId);
- if (i!=m_schemaLocMap.end())
- return new Wrapper4InputSource(new LocalFileInputSource(baseURI,i->second.c_str()));
-
- // Check for entity as a value in the map.
- for (i=m_schemaLocMap.begin(); i!=m_schemaLocMap.end(); ++i) {
- if (XMLString::endsWith(i->second.c_str(), systemId))
- return new Wrapper4InputSource(new LocalFileInputSource(baseURI,i->second.c_str()));
- }
+ map<xstring,xstring>::const_iterator i = m_schemaLocMap.find(systemId);
+ if (i != m_schemaLocMap.end())
+ return new Wrapper4InputSource(new LocalFileInputSource(baseURI, i->second.c_str()));
+
+ // Check for entity as a suffix of a value in the map.
+ i = find_if(
+ m_schemaLocMap.begin(), m_schemaLocMap.end(),
+ boost::bind(ends_with<const xstring&,const xstring&>, boost::bind(&map<xstring,xstring>::value_type::second, _1), systemId)
+ );
+ if (i != m_schemaLocMap.end())
+ return new Wrapper4InputSource(new LocalFileInputSource(baseURI, i->second.c_str()));