diff options
Diffstat (limited to 'src/function/read_xml_file.cc')
-rw-r--r-- | src/function/read_xml_file.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/function/read_xml_file.cc b/src/function/read_xml_file.cc index bf9ec2e..608e71a 100644 --- a/src/function/read_xml_file.cc +++ b/src/function/read_xml_file.cc @@ -9,6 +9,7 @@ #include "boost/filesystem/fstream.hpp" #include "support/xerces_string_guard.h" +#include "support/filesystem_context.h" namespace { @@ -30,18 +31,23 @@ inline xercesc::DOMNode* importDocumentElement( namespace InputXSLT { -FunctionReadXmlFile::FunctionReadXmlFile(const FilesystemContext& context): - fs_context_(context), +FunctionReadXmlFile::FunctionReadXmlFile(): document_cache_(std::make_shared<DomDocumentCache>()) { } xalan::XObjectPtr FunctionReadXmlFile::execute( xalan::XPathExecutionContext& executionContext, xalan::XalanNode*, const xalan::XObjectPtr argument, - const xalan::Locator* + const xalan::Locator* locator ) const { + const FilesystemContext fs_context( + boost::filesystem::path( + xercesc::XMLString::transcode(locator->getSystemId() + 7) + ).parent_path().string() + ); + const boost::filesystem::path filePath( - this->fs_context_.resolve(argument->str()) + fs_context.resolve(argument->str()) ); DomDocumentCache::item* const cachedDocument( |