aboutsummaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
authorAdrian Kummerländer2014-05-04 20:26:29 +0200
committerAdrian Kummerländer2014-05-04 20:26:29 +0200
commita0ddbb0ccba20123fc4e8243d962f86232282612 (patch)
tree6b1c7994fb74f11e224b26f5d97c6031461b11ec /src/support
parent261170cc5b6661106877dc2611dab281f4d91348 (diff)
downloadInputXSLT-a0ddbb0ccba20123fc4e8243d962f86232282612.tar
InputXSLT-a0ddbb0ccba20123fc4e8243d962f86232282612.tar.gz
InputXSLT-a0ddbb0ccba20123fc4e8243d962f86232282612.tar.bz2
InputXSLT-a0ddbb0ccba20123fc4e8243d962f86232282612.tar.lz
InputXSLT-a0ddbb0ccba20123fc4e8243d962f86232282612.tar.xz
InputXSLT-a0ddbb0ccba20123fc4e8243d962f86232282612.tar.zst
InputXSLT-a0ddbb0ccba20123fc4e8243d962f86232282612.zip
Changed FilesystemContext constructor to accept xalan::Locator*
* all instantiations of a FilesystemContext are currently based on information provided by a xalan::Locator instance provided to the external function execute member method * this change hides the stylesheet path extraction from the actual function implementation
Diffstat (limited to 'src/support')
-rw-r--r--src/support/filesystem_context.cc10
-rw-r--r--src/support/filesystem_context.h3
2 files changed, 10 insertions, 3 deletions
diff --git a/src/support/filesystem_context.cc b/src/support/filesystem_context.cc
index d3caf88..32646be 100644
--- a/src/support/filesystem_context.cc
+++ b/src/support/filesystem_context.cc
@@ -1,5 +1,7 @@
#include "filesystem_context.h"
+#include "support/xerces_string_guard.h"
+
namespace {
inline std::string xalanToString(const xalan::XalanDOMString& text) {
@@ -16,8 +18,12 @@ inline std::string xalanToString(const xalan::XalanDOMString& text) {
namespace InputXSLT {
-FilesystemContext::FilesystemContext(const std::string& path):
- path_(canonical(boost::filesystem::path(path))) { }
+FilesystemContext::FilesystemContext(const xalan::Locator* locator):
+ path_(boost::filesystem::canonical(
+ boost::filesystem::path(
+ *XercesStringGuard<char>(locator->getSystemId()) + 7
+ ).parent_path().string()
+ )) { }
boost::filesystem::path FilesystemContext::resolve(
const std::string& path) const {
diff --git a/src/support/filesystem_context.h b/src/support/filesystem_context.h
index cb3edd4..f743c89 100644
--- a/src/support/filesystem_context.h
+++ b/src/support/filesystem_context.h
@@ -2,6 +2,7 @@
#define INPUTXSLT_SRC_SUPPORT_FILESYSTEM_CONTEXT_H_
#include <xalanc/XalanDOM/XalanDOMString.hpp>
+#include <xalanc/XPath/Function.hpp>
#include "boost/filesystem.hpp"
@@ -14,7 +15,7 @@ namespace InputXSLT {
class FilesystemContext {
public:
- explicit FilesystemContext(const std::string&);
+ explicit FilesystemContext(const xalan::Locator*);
boost::filesystem::path resolve(const std::string&) const;
boost::filesystem::path resolve(const xalan::XalanDOMString&) const;