--- parser3/src/classes/xdoc.C 2003/12/11 09:36:51 1.126 +++ parser3/src/classes/xdoc.C 2004/01/30 14:35:11 1.129 @@ -9,7 +9,7 @@ #ifdef XML -static const char * const IDENT_XDOC_C="$Date: 2003/12/11 09:36:51 $"; +static const char * const IDENT_XDOC_C="$Date: 2004/01/30 14:35:11 $"; #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) @@ -642,6 +642,8 @@ static Xdoc2buf_result xdoc2buf(Request& OOE2STYLE(omitXmlDeclaration); xmlDoc *document=gdome_xml_doc_get_xmlDoc(vdoc.get_document()); + if(encoder) + document->encoding=BAD_CAST xmlMemStrdup(encoder->name); if(xsltSaveResultTo(outputBuffer.get(), document, stylesheet.get())<0) { GdomeException exc=0; throw XmlException(0, exc); @@ -819,9 +821,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 +829,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,