diff options
Diffstat (limited to 'src/transformation_facade.cc')
-rw-r--r-- | src/transformation_facade.cc | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/transformation_facade.cc b/src/transformation_facade.cc index 0f174d8..8b9e1a2 100644 --- a/src/transformation_facade.cc +++ b/src/transformation_facade.cc @@ -18,6 +18,7 @@ TransformationFacade::TransformationFacade( error_handler_() { this->transformer_.setEntityResolver(resolver); this->transformer_.setErrorHandler(&this->error_handler_); + this->transformer_.setProblemListener(&this->error_handler_); this->transformer_.compileStylesheet( xalan::XSLTInputSource(transformation.data()), @@ -66,27 +67,18 @@ auto TransformationFacade::generate( xalan::XSLTResultTarget&& outputTarget, StylesheetParameterGuard& ) -> return_type { - std::stringstream emptyStream("<dummy/>"); - xalan::XSLTInputSource inputSource(emptyStream); - - const int resultCode = this->transformer_.transform( - inputSource, - this->transformation_, - outputTarget - ); - - return_type errors(this->error_handler_.getCachedErrors()); - - if ( errors && resultCode != 0 ) { - errors->emplace_back( - "Transformation error with code " + - std::to_string(resultCode) + - ": " + - this->transformer_.getLastError() + if ( this->transformation_ != nullptr ) { + std::stringstream emptyStream("<dummy/>"); + xalan::XSLTInputSource inputSource(emptyStream); + + this->transformer_.transform( + inputSource, + this->transformation_, + outputTarget ); } - return errors; + return this->error_handler_.getCachedErrors(); } } |