--- parser3/src/classes/xdoc.C 2002/02/19 15:03:10 1.86 +++ parser3/src/classes/xdoc.C 2002/04/09 15:27:13 1.89 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: xdoc.C,v 1.86 2002/02/19 15:03:10 paf Exp $ + $Id: xdoc.C,v 1.89 2002/04/09 15:27:13 paf Exp $ */ #include "classes.h" #ifdef XML @@ -155,7 +155,7 @@ private: static void writeNode(Request& r, const String& method_name, GdomeNode *node, GdomeException exc) { if(!node || exc) - throw Exception(0, 0, + throw Exception( &method_name, exc); @@ -301,7 +301,7 @@ static void _getElementById(Request& r, VXnode& result=*new(pool) VXnode(pool, node); r.write_no_lang(result); } else if(exc || xmlHaveGenericErrors()) - throw Exception(0, 0, + throw Exception( &method_name, exc); } @@ -311,7 +311,7 @@ static void _importNode(Request& r, cons VXdoc& vdoc=*static_cast(r.self); GdomeNode *importedNode= - as_node(pool, method_name, params, 0, "importedNode must be node"); + as_node(method_name, params, 0, "importedNode must be node"); bool deep= params->as_bool(1, "deep must be bool", r); @@ -320,7 +320,7 @@ static void _importNode(Request& r, cons importedNode, deep, &exc); if(exc) - throw Exception(0, 0, + throw Exception( &method_name, exc); @@ -351,7 +351,7 @@ static void _create(Request& r, const St )); if(!document || xmlHaveGenericErrors()) { GdomeException exc=0; - throw Exception(0, 0, + throw Exception( &method_name, exc); } @@ -367,7 +367,7 @@ static void _create(Request& r, const St 0/*systemId* /, &exc); if(!documentType || exc || xmlHaveGenericErrors()) - throw Exception(0, 0, + throw Exception( &method_name, exc); */ @@ -377,7 +377,7 @@ static void _create(Request& r, const St 0/*doctype*/, &exc); if(!document || exc || xmlHaveGenericErrors()) - throw Exception(0, 0, + throw Exception( &method_name, exc); @@ -399,7 +399,7 @@ static void _load(Request& r, const Stri gdome_xml_n_mkref((xmlNode *)xmlParseFile(uri.cstr())); if(!document || xmlHaveGenericErrors()) { GdomeException exc=0; - throw Exception(0, 0, + throw Exception( &uri, exc); } @@ -426,7 +426,7 @@ static void param_option_over_output_opt else if(s=="no") output_option=false; else - throw Exception(0, 0, + throw Exception("parser.runtime", &s, "%s must be either 'yes' or 'no'", option_name); } @@ -507,7 +507,7 @@ static void xdoc2buf(Pool& pool, VXdoc& const char *encoding_cstr=oo.encoding->cstr(); xmlCharEncodingHandler *encoder=xmlFindCharEncodingHandler(encoding_cstr); if(!encoder) - throw Exception(0, 0, + throw Exception("parser.runtime", &method_name, "encoding '%s' not supported", encoding_cstr); // UTF-8 encoder contains empty input/output converters, @@ -520,7 +520,7 @@ static void xdoc2buf(Pool& pool, VXdoc& xsltStylesheet_auto_ptr stylesheet(xsltNewStylesheet()); if(!stylesheet.get()) - throw Exception(0, 0, + throw Exception(0, &method_name, "xsltNewStylesheet failed"); @@ -542,7 +542,7 @@ static void xdoc2buf(Pool& pool, VXdoc& xmlDoc *document=gdome_xml_doc_get_xmlDoc(vdoc.get_document(&method_name)); if(xsltSaveResultTo(outputBuffer.get(), document, stylesheet.get())<0) { GdomeException exc=0; - throw Exception(0, 0, + throw Exception( &method_name, exc); } @@ -626,9 +626,9 @@ static void add_xslt_param(const Hash::K void *info) { Value *meaning=static_cast(ameaning); Pool& pool=meaning->pool(); - const char **transform_params=(const char **)info; - *transform_params++=pool.transcode(aattribute)->str; - *transform_params++=pool.transcode(meaning->as_string())->str; + const char ** & current_transform_param=*(const char ***)info; + *current_transform_param++=pool.transcode(aattribute)->str; + *current_transform_param++=pool.transcode(meaning->as_string())->str; } static void _transform(Request& r, const String& method_name, MethodParams *params) { //_asm int 3; @@ -641,12 +641,12 @@ static void _transform(Request& r, const Value& vparams=params->as_no_junction(1, "transform parameters must be hash"); if(vparams.is_defined()) if(Hash *params=vparams.get_hash(&method_name)) { - transform_params= - (const char **)pool.malloc(sizeof(const char *)*params->size()*2+1); - params->for_each(add_xslt_param, transform_params); + const char **current_transform_param=transform_params= + (const char **)pool.malloc(sizeof(const char *)*(params->size()*2+1)); + params->for_each(add_xslt_param, ¤t_transform_param); transform_params[params->size()*2]=0; } else - throw Exception(0, 0, + throw Exception("parser.runtime", &method_name, "transform parameters parameter must be hash"); } @@ -669,7 +669,7 @@ static void _transform(Request& r, const transformContext.get()); if(!transformed || xmlHaveGenericErrors()) { GdomeException exc=0; - throw Exception(0, 0, + throw Exception( &stylesheet_filespec, exc); } @@ -679,7 +679,7 @@ static void _transform(Request& r, const // constructing result GdomeDocument *gdomeDocument=gdome_xml_doc_mkref(transformed); if(!gdomeDocument) - throw Exception(0, 0, + throw Exception(0, &method_name, "gdome_xml_doc_mkref failed"); VXdoc& result=*new(pool) VXdoc(pool, gdomeDocument);