|
|
| version 1.34, 2001/10/23 14:43:44 | version 1.35, 2001/10/26 12:21:35 |
|---|---|
| Line 621 static void add_xslt_param(const Hash::K | Line 621 static void add_xslt_param(const Hash::K |
| XalanDOMString(attribute_cstr), | XalanDOMString(attribute_cstr), |
| XalanDOMString(meaning_cstr)); | XalanDOMString(meaning_cstr)); |
| } | } |
| /* | |
| static void _transform(Request& r, const String& method_name, MethodParams *params) { | |
| Pool& pool=r.pool(); | |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | |
| // params | |
| if(params->size()>1) { | |
| Value& vparams=params->as_no_junction(1, "transform parameters parameter must be string"); | |
| if(vparams.is_defined()) | |
| if(Hash *params=vparams.get_hash()) | |
| params->for_each(add_xslt_param, &vdoc.transformer()); | |
| else | |
| throw Exception(0, 0, | |
| &method_name, | |
| "transform parameters parameter must be hash"); | |
| } | |
| // source | |
| const XalanParsedSource &parsed_source=vdoc.get_parsed_source(pool, &method_name); | |
| // stylesheet | |
| const String& stylesheet_file_name=params->as_string(0, "file name must be string"); | |
| const String& stylesheet_filespec=r.absolute(stylesheet_file_name); | |
| //_asm int 3; | |
| Stylesheet_connection& connection=XSLT_stylesheet_manager->get_connection(stylesheet_filespec); | |
| // target | |
| XalanDocument* target=vdoc.parser_liaison().createDocument(); | |
| // transform | |
| try { | |
| vdoc.transformer().transform2( | |
| parsed_source, | |
| &connection.stylesheet(true/*nocache* /), | |
| target); | |
| } | |
| catch (XSLException& e) { | |
| connection.close(); | |
| Exception::provide_source(pool, &stylesheet_file_name, e); | |
| } | |
| catch (SAXParseException& e) { | |
| connection.close(); | |
| Exception::provide_source(pool, &stylesheet_file_name, e); | |
| } | |
| catch (SAXException& e) { | |
| connection.close(); | |
| Exception::provide_source(pool, &stylesheet_file_name, e); | |
| } | |
| catch (XMLException& e) { | |
| connection.close(); | |
| Exception::provide_source(pool, &stylesheet_file_name, e); | |
| } | |
| catch(const XalanDOMException& e) { | |
| connection.close(); | |
| Exception::provide_source(pool, &stylesheet_file_name, e); | |
| } | |
| // write out result | |
| VXdoc& result=*new(pool) VXdoc(pool); | |
| result.set_document(*target); | |
| r.write_no_lang(result); | |
| } | |
| */ | |
| static void _transform(Request& r, const String& method_name, MethodParams *params) { | static void _transform(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.self); |
| Line 700 static void _transform(Request& r, const | Line 638 static void _transform(Request& r, const |
| "transform parameters parameter must be hash"); | "transform parameters parameter must be hash"); |
| } | } |
| // source | |
| XalanDocument &xalan_document=vdoc.get_document(pool, &method_name); | |
| // stylesheet | // stylesheet |
| const String& stylesheet_file_name=params->as_string(0, "file name must be string"); | const String& stylesheet_file_name=params->as_string(0, "file name must be string"); |
| const String& stylesheet_filespec=r.absolute(stylesheet_file_name); | const String& stylesheet_filespec=r.absolute(stylesheet_file_name); |
| Line 710 static void _transform(Request& r, const | Line 645 static void _transform(Request& r, const |
| Stylesheet_connection& connection=stylesheet_manager->get_connection(stylesheet_filespec); | Stylesheet_connection& connection=stylesheet_manager->get_connection(stylesheet_filespec); |
| // target | // target |
| XalanDocument* target=vdoc.parser_liaison().createDocument(); | XalanDocument* target=vdoc.parser_xerces_liaison().createDocument(); |
| // transform | // transform |
| try { | try { |
| vdoc.transformer().transform2( | if(vdoc.has_parsed_source()) { // set|load, not create? |
| &xalan_document, | vdoc.transformer().transform2( |
| &connection.stylesheet(true/*nocache*/), | vdoc.get_parsed_source(pool, &method_name), |
| target); | &connection.stylesheet(true/*nocache*/), |
| target); | |
| } else { | |
| target=vdoc.parser_xerces_liaison().createDocument(); | |
| vdoc.transformer().transform2( | |
| vdoc.get_document(pool, &method_name), | |
| &connection.stylesheet(true/*nocache*/), | |
| target); | |
| } | |
| } | } |
| catch (XSLException& e) { | catch (XSLException& e) { |
| connection.close(); | connection.close(); |