|
|
| version 1.35, 2001/10/26 12:21:35 | version 1.44, 2001/11/09 12:09:53 |
|---|---|
| Line 2 | Line 2 |
| Parser: @b xdoc parser class. | Parser: @b xdoc parser class. |
| Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf) | Author: Alexander Petrosyan <paf@design.ru> (http://paf.design.ru) |
| $Id$ | $Id$ |
| */ | */ |
| Line 511 static void _file(Request& r, const Stri | Line 511 static void _file(Request& r, const Stri |
| Value *vcontent_type; | Value *vcontent_type; |
| if(charset) { | if(charset) { |
| VHash *vhcontent_type=new(pool) VHash(pool); | VHash *vhcontent_type=new(pool) VHash(pool); |
| vhcontent_type->hash().put(*value_name, new(pool) VString(*scontent_type)); | vhcontent_type->hash(&method_name).put(*value_name, new(pool) VString(*scontent_type)); |
| String *scharset=new(pool) String(pool, charset); | String *scharset=new(pool) String(pool, charset); |
| vhcontent_type->hash().put(*new(pool) String(pool, "charset"), new(pool) VString(*scharset)); | vhcontent_type->hash(&method_name).put(*new(pool) String(pool, "charset"), new(pool) VString(*scharset)); |
| vcontent_type=vhcontent_type; | vcontent_type=vhcontent_type; |
| } else | } else |
| vcontent_type=new(pool) VString(*scontent_type); | vcontent_type=new(pool) VString(*scontent_type); |
| Line 533 static void _set(Request& r, const Strin | Line 533 static void _set(Request& r, const Strin |
| Temp_lang temp_lang(r, String::UL_XML); | Temp_lang temp_lang(r, String::UL_XML); |
| const String& xml=r.process(vxml).as_string(); | const String& xml=r.process(vxml).as_string(); |
| std::istrstream stream(xml.cstr()); | std::istrstream stream( |
| xml.cstr(String::UL_UNSPECIFIED, r.connection)); | |
| const XalanParsedSource* parsedSource; | const XalanParsedSource* parsedSource; |
| try { | try { |
| Line 611 static void _load(Request& r, const Stri | Line 612 static void _load(Request& r, const Stri |
| vdoc.set_parsed_source(*parsedSource); | vdoc.set_parsed_source(*parsedSource); |
| } | } |
| /// @test lang=String::UL_UNSPECIFIED? | |
| static void add_xslt_param(const Hash::Key& aattribute, Hash::Val *ameaning, | static void add_xslt_param(const Hash::Key& aattribute, Hash::Val *ameaning, |
| void *info) { | void *info) { |
| XalanTransformer2& transformer=*static_cast<XalanTransformer2 *>(info); | XalanTransformer2& transformer=*static_cast<XalanTransformer2 *>(info); |
| const char *attribute_cstr=aattribute.cstr(); | const char *attribute_cstr=aattribute.cstr(String::UL_UNSPECIFIED); |
| const char *meaning_cstr=static_cast<Value *>(ameaning)->as_string().cstr(); | const char *meaning_cstr=static_cast<Value *>(ameaning)->as_string().cstr(String::UL_UNSPECIFIED); |
| transformer.setStylesheetParam( | transformer.setStylesheetParam( |
| XalanDOMString(attribute_cstr), | XalanDOMString(attribute_cstr), |
| Line 649 static void _transform(Request& r, const | Line 651 static void _transform(Request& r, const |
| // transform | // transform |
| try { | try { |
| // note: | |
| // actually, never found any difference between the two | |
| // but still there some extra "xerces" words at start of transform body | |
| // wich were originally "xalan" | |
| // not daring to change that | |
| if(vdoc.has_parsed_source()) { // set|load, not create? | if(vdoc.has_parsed_source()) { // set|load, not create? |
| vdoc.transformer().transform2( | vdoc.transformer().transform2( |
| vdoc.get_parsed_source(pool, &method_name), | vdoc.get_parsed_source(pool, &method_name), |
| Line 683 static void _transform(Request& r, const | Line 690 static void _transform(Request& r, const |
| Exception::provide_source(pool, &stylesheet_file_name, e); | Exception::provide_source(pool, &stylesheet_file_name, e); |
| } | } |
| // close | |
| connection.close(); | |
| // write out result | // write out result |
| VXdoc& result=*new(pool) VXdoc(pool, target, false/*owns not*/); | VXdoc& result=*new(pool) VXdoc(pool, target, false/*owns not*/); |
| r.write_no_lang(result); | r.write_no_lang(result); |