--- parser3/src/classes/xdoc.C 2003/12/11 09:25:50 1.125 +++ parser3/src/classes/xdoc.C 2004/01/22 09:34:05 1.128 @@ -9,7 +9,7 @@ #ifdef XML -static const char * const IDENT_XDOC_C="$Date: 2003/12/11 09:25:50 $"; +static const char * const IDENT_XDOC_C="$Date: 2004/01/22 09:34:05 $"; #include "gdome.h" #include "libxml/tree.h" @@ -413,7 +413,7 @@ static void _create(Request& r, MethodPa Temp_lang temp_lang(r, String::L_XML); const String& xml=r.process_to_string(param); - const char* cstr=xml.cstr(String::L_UNSPECIFIED); + const char* cstr=xml.cstr(String::L_UNSPECIFIED, 0, &r.charsets); document=(GdomeDocument *) gdome_xml_n_mkref((xmlNode *)xmlParseMemory( cstr, strlen(cstr) @@ -686,7 +686,7 @@ static void _file(Request& r, MethodPara value_name, new VString(*oo.mediaType)); vhcontent_type.hash().put( - "charset", + String::Body("charset"), new VString(*oo.encoding)); vfile.set(false/*tainted*/, buf.str?buf.str:""/*to distinguish from stat-ed file*/, buf.length, @@ -819,9 +819,6 @@ static void _transform(Request& r, Metho static_cast(vxdoc)->get_document()); // compile xdoc stylesheet xsltStylesheet_auto_ptr stylesheet_ptr(xsltParseStylesheetDoc(document)); - // strange thing - xsltParseStylesheetDoc records document and destroys it in stylesheet destructor - // we don't need that - stylesheet_ptr->doc=0; if(xmlHaveGenericErrors()) { GdomeException exc=0; throw XmlException(0, exc); @@ -830,6 +827,9 @@ static void _transform(Request& r, Metho throw Exception("xml", 0, "stylesheet failed to compile"); + // strange thing - xsltParseStylesheetDoc records document and destroys it in stylesheet destructor + // we don't need that + stylesheet_ptr->doc=0; // transform! result=&_transform(r, 0,