From 22117c6c64d45c0c6b964a10732d9104fa59c314 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 20 Aug 2014 13:53:25 -0700 Subject: [PATCH] code comments to clarify when/why base_path is needed at parse time when loading from a string --- src/libxml2_loader.cpp | 2 +- src/rapidxml_loader.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libxml2_loader.cpp b/src/libxml2_loader.cpp index 447a1b0be..5c6ed4c8a 100644 --- a/src/libxml2_loader.cpp +++ b/src/libxml2_loader.cpp @@ -107,7 +107,7 @@ public: base_path + "': file or directory does not exist"); } } - + // NOTE: base_path here helps libxml2 resolve entities correctly: https://github.com/mapnik/mapnik/issues/440 xmlDocPtr doc = xmlCtxtReadMemory(ctx_, buffer.data(), buffer.length(), base_path.c_str(), encoding_, options_); load(doc, node); diff --git a/src/rapidxml_loader.cpp b/src/rapidxml_loader.cpp index 4a5e07ccc..4ede18d67 100644 --- a/src/rapidxml_loader.cpp +++ b/src/rapidxml_loader.cpp @@ -97,8 +97,9 @@ public: } } - void load_string(std::string const& buffer, xml_node &node, std::string const & base_path ) + void load_string(std::string const& buffer, xml_node &node, std::string const & ) { + // Note: base_path ignored because its not relevant - only needed for xml2 to load entities (see libxml2_loader.cpp) load_array(std::string(buffer), node); } private: