--- parser3/src/classes/xdoc.C 2009/07/06 12:13:30 1.162 +++ parser3/src/classes/xdoc.C 2009/09/08 09:11:51 1.165 @@ -9,7 +9,7 @@ #ifdef XML -static const char * const IDENT_XDOC_C="$Date: 2009/07/06 12:13:30 $"; +static const char * const IDENT_XDOC_C="$Date: 2009/09/08 09:11:51 $"; #include "libxml/tree.h" #include "libxml/HTMLtree.h" @@ -42,7 +42,7 @@ static const char * const IDENT_XDOC_C=" class MXdoc: public MXnode { public: // VStateless_class - Value* create_new_value(Pool&, HashStringValue*) { return new VXdoc(); } + Value* create_new_value(Pool&) { return new VXdoc(); } public: MXdoc(); @@ -391,8 +391,9 @@ 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.untaint_cstr(String::L_AS_IS, 0, &r.charsets); - xmldoc=xmlParseMemory(cstr, strlen(cstr)); + String::Body sbody=xml.cstr_to_string_body_untaint(r.flang, 0, &r.charsets); + xmldoc=xmlParseMemory(sbody.cstr(), sbody.length()); + //printf("document=0x%p\n", document); if(!xmldoc || xmlHaveGenericErrors()) throw XmlException(0); @@ -633,8 +634,10 @@ static Xdoc2buf_result xdoc2buf(Request& result.str=0; if(file_spec) - file_write(*file_spec, - gnome_str, gnome_length, + file_write(r.charsets, + *file_spec, + gnome_str, + gnome_length, true/*as_text*/); return result; @@ -781,7 +784,7 @@ static void _transform(Request& r, Metho } VXdoc* result; - if(Value *vxdoc=params[0].as(VXDOC_TYPE, false)) { // stylesheet (xdoc) + if(Value *vxdoc=params[0].as(VXDOC_TYPE)) { // stylesheet (xdoc) xmlDoc& stylesheetdoc=static_cast(vxdoc)->get_xmldoc(); // compile xdoc stylesheet xsltStylesheet_auto_ptr stylesheet_ptr(xsltParseStylesheetDoc(&stylesheetdoc));