--- parser3/src/classes/xdoc.C 2001/10/29 13:04:46 1.38 +++ parser3/src/classes/xdoc.C 2001/11/09 12:09:53 1.44 @@ -2,9 +2,9 @@ Parser: @b xdoc parser class. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) + Author: Alexander Petrosyan (http://paf.design.ru) - $Id: xdoc.C,v 1.38 2001/10/29 13:04:46 paf Exp $ + $Id: xdoc.C,v 1.44 2001/11/09 12:09:53 paf Exp $ */ #include "pa_types.h" #include "classes.h" @@ -77,9 +77,7 @@ static void _createElement(Request& r, c Pool& pool=r.pool(); VXdoc& vdoc=*static_cast(r.self); - Temp_lang temp_lang(r, String::UL_XML); - Value& tagName_code=params->as_junction(0, "tagName must be string"); - const String& tagName=r.process(tagName_code).as_string(); + const String& tagName=params->as_string(0, "tagName must be string"); try { XalanNode *node= @@ -111,9 +109,7 @@ static void _createTextNode(Request& r, Pool& pool=r.pool(); VXdoc& vdoc=*static_cast(r.self); - Temp_lang temp_lang(r, String::UL_XML); - Value& data_code=params->as_junction(0, "data must be string"); - const String& data=r.process(data_code).as_string(); + const String& data=params->as_string(0, "data must be string"); XalanNode *node= vdoc.get_document(pool, &method_name). @@ -515,9 +511,9 @@ static void _file(Request& r, const Stri Value *vcontent_type; if(charset) { 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); - 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; } else vcontent_type=new(pool) VString(*scontent_type); @@ -537,7 +533,8 @@ static void _set(Request& r, const Strin Temp_lang temp_lang(r, String::UL_XML); 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; try { @@ -693,6 +690,9 @@ static void _transform(Request& r, const Exception::provide_source(pool, &stylesheet_file_name, e); } + // close + connection.close(); + // write out result VXdoc& result=*new(pool) VXdoc(pool, target, false/*owns not*/); r.write_no_lang(result);