From 4d0569669e01434b3bb9f689cd176f590344bea8 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Thu, 22 May 2014 19:58:15 +0200 Subject: Added include path resolution to external file access functions * if a given file can not be located relative to the transformation's location both "read-file" and "read-xml-file" will now try to resolve the path using the IncludeEntityResolver * all external functions based on the FunctionBase template are now provided with a pointer to a IncludeEntityResolver instance * it is determined by the external function implementation whether include path resolution will be used --- src/function/base.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/function/base.h') diff --git a/src/function/base.h b/src/function/base.h index cc207c3..3609201 100644 --- a/src/function/base.h +++ b/src/function/base.h @@ -10,9 +10,10 @@ #include "common.h" #include "support/xalan_string.h" +#include "support/filesystem_context.h" +#include "support/include_entity_resolver.h" #include "support/tuple/mapper.h" #include "support/dom/document_cache.h" -#include "support/filesystem_context.h" namespace InputXSLT { @@ -24,7 +25,8 @@ class FunctionBase : public xalan::Function { public: typedef std::tuple parameter_tuple; - FunctionBase(): + FunctionBase(IncludeEntityResolver* resolver): + include_resolver_(resolver), document_cache_(std::make_shared()) { } virtual xalan::XObjectPtr execute( @@ -73,6 +75,9 @@ class FunctionBase : public xalan::Function { FunctionBase& operator=(const FunctionBase&) = delete; bool operator==(const FunctionBase&) const = delete; + protected: + IncludeEntityResolver* const include_resolver_; + private: std::shared_ptr document_cache_; -- cgit v1.2.3