From 938ed7622656c3494ae8fdb83bc2ad4b1f31d901 Mon Sep 17 00:00:00 2001 From: Adrian Kummerländer Date: Fri, 25 Apr 2014 17:44:32 +0200 Subject: Improved argument resolution and error handling * execute member method internal argument count checks are not needed when using between one and two arguments ** xalan automatically generates the appropriate message containing the getError message when only offered fixed argument execute member overloads * improved FunctionReadDirectory attribute element generation * added additional validations to FunctionReadFile and FunctionReadXMLFile * I plan to return errors inside a DOM tree alongside the function return values in the future --- src/transformation_facade.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/transformation_facade.cc') diff --git a/src/transformation_facade.cc b/src/transformation_facade.cc index 19f7772..38dfe93 100644 --- a/src/transformation_facade.cc +++ b/src/transformation_facade.cc @@ -4,6 +4,7 @@ #include #include +#include #include "function/read_file.h" #include "function/read_xml_file.h" @@ -54,11 +55,17 @@ int TransformationFacade::generate(const std::string& target) { xalan::XSLTInputSource inputSource(emptyStream); xalan::XSLTResultTarget outputTarget(target.data()); - return this->transformer_.transform( + const int resultCode = this->transformer_.transform( inputSource, this->transformation_, outputTarget ); + + if ( resultCode != 0 ) { + std::cerr << this->transformer_.getLastError() << std::endl; + } + + return resultCode; } } -- cgit v1.2.3