--- parser3/src/include/pa_stylesheet_connection.h 2002/01/16 10:28:35 1.19 +++ parser3/src/include/pa_stylesheet_connection.h 2003/01/21 15:51:11 1.32 @@ -1,16 +1,16 @@ /** @file Parser: Stylesheet connection decl. - Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://paf.design.ru) - - $Id: pa_stylesheet_connection.h,v 1.19 2002/01/16 10:28:35 paf Exp $ + Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexandr Petrosian (http://paf.design.ru) */ #ifndef PA_STYLESHEET_CONNECTION_H #define PA_STYLESHEET_CONNECTION_H -#include "libxslt/libxslt.h" +static const char* IDENT_STYLESHEET_CONNECTION_H="$Date: 2003/01/21 15:51:11 $"; + +#include "libxslt/xslt.h" #include "libxslt/xsltInternals.h" #include "pa_pool.h" @@ -76,16 +76,22 @@ private: return now_disk_time>prev_disk_time?now_disk_time:0; } - /// @test grab errors void load(time_t new_disk_time) { Pool& pool=*fservices_pool; - xsltStylesheet *nstylesheet; - nstylesheet=xsltParseStylesheetFile(BAD_CAST ffile_spec.cstr(String::UL_FILE_SPEC)); + int saved=xmlDoValidityCheckingDefaultValue;// + xmlDoValidityCheckingDefaultValue=0;// + xsltStylesheet *nstylesheet= + xsltParseStylesheetFile(BAD_CAST ffile_spec.cstr(String::UL_FILE_SPEC)); + xmlDoValidityCheckingDefaultValue = saved;// + if(xmlHaveGenericErrors()) { + GdomeException exc=0; + throw Exception(&ffile_spec, exc); + } if(!nstylesheet) - throw Exception(0, 0, + throw Exception("file.missing", &ffile_spec, - "error compiling. TODO: grab errors"); + "stylesheet failed to load"); xsltFreeStylesheet(fstylesheet); fstylesheet=nstylesheet; @@ -95,7 +101,7 @@ private: time_t get_disk_time() { size_t size; time_t atime, mtime, ctime; - String stamp_file_spec(ffile_spec); + String stamp_file_spec(ffile_spec); stamp_file_spec << STYLESHEET_FILENAME_STAMP_SUFFIX; // {file_spec}.stamp modification time OR {file_spec} const String& stat_file_spec=file_readable(stamp_file_spec)?stamp_file_spec:ffile_spec;