From 741a70f5fecc38033832728f4ecc62a6abe328b2 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 16 Jun 2014 23:01:23 +0200 Subject: Prepared TransformationFacade and FunctionTransform for parameter change * FunctionTransform was adapted to support passing the transformation as either a string path or directly as a node-set / result-tree ** this in turn required changes to the TransformationFacade ** the implementation of a xalan::XSLTInputSource specialization for the XObjectValue::get template method was also required * changed ixslt executable to match TransformationFacade constructor changes * these changes were implemented in preparation for a restructuring of how the separate external functions provided by InputXSLT operate and work together ** the approach up until now was to provide non-combinable external functions for distinct task such as "read a file" and "transform that transformation using these parameters into that file" ** if you think about the areas of operations of these functions are overlapping quite a bit *** e.g. FunctionTransform reads files, transforms DOM structures and writes files instead of only transforming things ** the new approach will be to limit the feature set of each function in the attempt of making the clearer and increasing their combinability *** e.g. FunctionTransform won't read or write files but expect both the input-DOM and the transformation-DOM as node-sets or result trees and return the transformed document as a node-set to be written using FunctionWriteFile (to be implemented) --- src/transformation_facade.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/transformation_facade.h') diff --git a/src/transformation_facade.h b/src/transformation_facade.h index fe711bc..ca72c90 100644 --- a/src/transformation_facade.h +++ b/src/transformation_facade.h @@ -26,10 +26,17 @@ class TransformationFacade { Arguments&&... ); - TransformationFacade(const std::string&, IncludeEntityResolver*); + template + TransformationFacade(Arguments&&..., IncludeEntityResolver*); + TransformationFacade( - const std::string&, - const std::string&, + xalan::XSLTInputSource, + IncludeEntityResolver* + ); + + TransformationFacade( + xalan::XSLTInputSource, + xalan::XSLTInputSource, IncludeEntityResolver* ); @@ -79,6 +86,16 @@ auto TransformationFacade::try_create( } } +template +TransformationFacade::TransformationFacade( + Arguments&&... arguments, + IncludeEntityResolver* resolver +): + TransformationFacade( + xalan::XSLTInputSource(std::forward(arguments))..., + resolver + ) { } + template void TransformationFacade::generate(Target& target) { StylesheetParameterGuard guard(this->transformer_); -- cgit v1.2.3