From 516ff636f760458c33676458fc88892faab9d376 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Mon, 9 Jun 2014 14:24:26 +0200 Subject: Added include path resolution to FilesystemContext constructor * extracted system id handling into separate "resolve" method overload of "IncludeEntityResolver" class * paths to be resolved against the include path vector are enclosed by square brackets ** FilesystemContext for external functions was instantiated using the unmodified systemId provided by xalan::Locator ** this commit adds include path resolution to that step *** exceptions were thrown as the program tried to instantiate a FilesystemContext instance without resolving the square bracket syntax * changed FunctionTransform "target" attribute content to the target path filename instead of the full path --- src/function/transform.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/function/transform.cc') diff --git a/src/function/transform.cc b/src/function/transform.cc index 7e6207c..059260d 100644 --- a/src/function/transform.cc +++ b/src/function/transform.cc @@ -34,9 +34,6 @@ xercesc::DOMDocument* FunctionTransform::constructDocument( std::string targetPath, xalan::XObjectPtr parameterObject ) { - transformationPath = fsContext.resolve(transformationPath).string(); - targetPath = fsContext.resolve(targetPath).string(); - xercesc::DOMDocument* const domDocument( xercesc::DOMImplementation::getImplementation()->createDocument( nullptr, @@ -50,15 +47,22 @@ xercesc::DOMDocument* FunctionTransform::constructDocument( ); ResultNodeFacade result(domDocument, rootNode, "transformation"); - result.setAttribute("target", targetPath); + + result.setAttribute( + "target", + boost::filesystem::path(targetPath).filename().string() + ); if ( auto transformation = TransformationFacade::try_create( - transformationPath, + fsContext.resolve(transformationPath).string(), this->include_resolver_, handleErrors(result) ) ) { try { - transformation->generate(targetPath, parameterObject); + transformation->generate( + fsContext.resolve(targetPath).string(), + parameterObject + ); result.setAttribute("result", "success"); } -- cgit v1.2.3