summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project2/xml/xmlDocumentCache.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/project2/xml/xmlDocumentCache.cpp b/project2/xml/xmlDocumentCache.cpp
index 96848e7..cbc13ed 100644
--- a/project2/xml/xmlDocumentCache.cpp
+++ b/project2/xml/xmlDocumentCache.cpp
@@ -50,6 +50,13 @@ class XmlDocumentCachePopulator : public CurlCompleteCallback {
XmlDocumentCache::documents.insert(XmlDocumentCache::Documents::value_type(url,
boost::bind(helperThrow<XmlParseError>, std::string(xmlGetLastError()->message))));
}
+
+ // Dirty hack alert
+ // xmlpp doesn't play nicely with HTML documents...
+ // sooo ummm, lie and hope it doesn't break something else
+ doc->type = XML_DOCUMENT_NODE;
+ // end hack
+
XmlDocumentCache::documents.insert(XmlDocumentCache::Documents::value_type(url,
boost::bind(helperReturnDocument, XmlDocumentCache::DocumentPtr(new xmlpp::Document(doc)))));
Logger()->messagebf(LOG_DEBUG, "Download of '%s' completed, stored", url);
@@ -101,6 +108,7 @@ class XmlDocumentCacheClearer : public ComponentLoader {
{
Logger()->messagef(LOG_DEBUG, "%s: Clearing XML document cache", __PRETTY_FUNCTION__);
XmlDocumentCache::documents.clear();
+ Logger()->messagef(LOG_DEBUG, "%s: Cleared XML document cache", __PRETTY_FUNCTION__);
}
};
DECLARE_CUSTOM_COMPONENT_LOADER("XmlDocumentCacheClearer", XmlDocumentCacheClearer, XmlDocumentCacheClearer, ComponentLoader);