--- parser3/src/main/pa_xml_io.C 2008/06/11 11:39:40 1.22 +++ parser3/src/main/pa_xml_io.C 2009/09/25 12:58:39 1.26 @@ -1,7 +1,7 @@ /** @file Parser: plugins to xml library, controlling i/o; implementation - Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -9,7 +9,7 @@ #ifdef XML -static const char * const IDENT="$Date: 2008/06/11 11:39:40 $"; +static const char * const IDENT="$Date: 2009/09/25 12:58:39 $"; #include "libxslt/extensions.h" @@ -106,9 +106,20 @@ xmlFileOpen_ReadIntoStream (const char* do_not_store_filename=adjust_buf; } else if(!strstr(do_not_store_filename, "http://")) - if(strstr(do_not_store_filename, "file://")) - do_not_store_filename+=7/*strlen("file://")*/; - else if(*do_not_store_filename && do_not_store_filename[1]!=':' && strstr(do_not_store_filename, "://")) { + if(strstr(do_not_store_filename, "file://")){ + do_not_store_filename+=7/*strlen("file://")*/; +#ifdef WIN32 + if( + do_not_store_filename[0]=='/' + && do_not_store_filename[1] + && do_not_store_filename[2]==':' + && do_not_store_filename[3]=='/' + ){ + // skip leading slash for absolute path file:///C:/path/to/file + do_not_store_filename++; + } +#endif + } else if(*do_not_store_filename && do_not_store_filename[1]!=':' && strstr(do_not_store_filename, "://")) { pa_xmlStopMonitoringDependencies(); return 0; // plug out [do not handle other prefixes] } @@ -118,7 +129,7 @@ xmlFileOpen_ReadIntoStream (const char* const char *buf; try { - buf=file_read_text(r.charsets, *new String(can_store_filename), + buf=file_load_text(r, *new String(can_store_filename), true/*fail_on_read_problem*/, 0/*params*/, false/*don't transcode result because it must be fit with @encoding value!*/); @@ -201,7 +212,7 @@ xmlFileOpenMethod (const char* afilename Request::Execute_nonvirtual_method_result body= r.execute_nonvirtual_method(r.main_class, *method, vparam, true); if(body.string) { - buf=body.string->cstr(String::L_UNSPECIFIED); + buf=body.string->untaint_cstr(r.flang); } else throw Exception(0, new String(afilename),