From 7b872121000d4db4026d0c90fcb95a10f1e43694 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Wed, 25 Jun 2014 20:23:35 +0200 Subject: Added support for resolving non-existing paths * previous logic for resolving boost::filesystem::path parameters in the XObjectValue class actively tried to resolve existing files ** this contradicts the planned introduction of e.g. a external "write-file" function * callers of external functions with path arguments now have to enclose them in square brackets if include path resolution is required ** analog to the usage of the "xsl:import" tag * moved "getPathFromSystemId" from compilation local method into static method of IncludeEntityResolver * changed test cases accordingly --- src/support/type/xobject_value.cc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'src/support/type') diff --git a/src/support/type/xobject_value.cc b/src/support/type/xobject_value.cc index 0236597..46ce53c 100644 --- a/src/support/type/xobject_value.cc +++ b/src/support/type/xobject_value.cc @@ -28,23 +28,14 @@ std::string XObjectValue::get( template <> boost::filesystem::path XObjectValue::get( const xalan::XObjectPtr& ptr) const { - const boost::filesystem::path rawPath( - toString(ptr->str()) + const std::string rawPath( + this->get(ptr) ); - const boost::filesystem::path filePath( - this->filesystem_context_.resolve(rawPath) - ); - - if ( !(boost::filesystem::exists(filePath) && - boost::filesystem::is_regular_file(filePath)) ) { - if ( auto resolvedPath = this->include_resolver_->resolve(rawPath) ) { - return *resolvedPath; - } else { - return filePath; - } + if ( auto resolvedPath = this->include_resolver_->resolve(rawPath) ) { + return *resolvedPath; } else { - return filePath; + return this->filesystem_context_.resolve(rawPath); } } -- cgit v1.2.3