--- parser3/src/include/pa_stylesheet_connection.h 2001/10/02 17:11:41 1.8 +++ parser3/src/include/pa_stylesheet_connection.h 2001/10/09 14:25:30 1.10 @@ -4,7 +4,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_stylesheet_connection.h,v 1.8 2001/10/02 17:11:41 parser Exp $ + $Id: pa_stylesheet_connection.h,v 1.10 2001/10/09 14:25:30 parser Exp $ */ #ifndef PA_STYLESHEET_CONNECTION_H @@ -16,6 +16,8 @@ #include "pa_exception.h" #include "pa_common.h" +#include "XalanTransformer2.hpp" + // defines #define STYLESHEET_FILENAME_STAMP_SUFFIX ".stamp" @@ -28,7 +30,7 @@ class Stylesheet_connection : public Poo public: Stylesheet_connection(Pool& pool, const String& afile_spec) : Pooled(pool), - ftransformer(new XalanTransformer), + ftransformer(new XalanTransformer2), ffile_spec(afile_spec), time_used(0), @@ -77,11 +79,24 @@ private: void load(time_t new_disk_time) { Pool& pool=*fservices_pool; - int error=ftransformer->compileStylesheet(ffile_spec.cstr(String::UL_FILE_SPEC), fstylesheet); - if(error) - PTHROW(0, 0, - &ffile_spec, - ftransformer->getLastError()); + try{ + ftransformer->compileStylesheet2(ffile_spec.cstr(String::UL_FILE_SPEC), fstylesheet); + } + catch (XSLException& e) { + pool._throw(&ffile_spec, e); + } + catch (SAXParseException& e) { + pool._throw(&ffile_spec, e); + } + catch (SAXException& e) { + pool._throw(&ffile_spec, e); + } + catch (XMLException& e) { + pool._throw(&ffile_spec, e); + } + catch(const XalanDOMException& e) { + pool._throw(&ffile_spec, e); + } prev_disk_time=new_disk_time; } @@ -110,7 +125,7 @@ private: private: - XalanTransformer *ftransformer; + XalanTransformer2 *ftransformer; Pool *fservices_pool; };