--- parser3/src/main/pa_xml_io.C 2003/11/28 09:24:52 1.3 +++ parser3/src/main/pa_xml_io.C 2003/11/28 09:36:26 1.7 @@ -9,7 +9,7 @@ #ifdef XML -static const char * const IDENT="$Date: 2003/11/28 09:24:52 $"; +static const char * const IDENT="$Date: 2003/11/28 09:36:26 $"; #include "libxslt/extensions.h" @@ -45,7 +45,6 @@ xmlFileMatchLocalhost(const char* filena */ static void * xmlFileOpenLocalhost (const char* filename) { - //_asm int 3; FILE *fd; const char* document_root=pa_thread_request().request_info.document_root; if(!document_root) @@ -119,20 +118,23 @@ xmlFileMatchMethod(const char* filename) return(0); } -/// parser://method/param/here -> ^/abc | ./abc +/// parser://method/param/here -> ^MAIN:method[/params/here] static void * xmlFileOpenMethod (const char* afilename) { - //_asm int 3; Request& r=pa_thread_request(); char* s=pa_strdup(afilename+9 /*strlen("parser://")*/); const char* method_cstr=lsplit(&s, '/'); const String* method=new String(method_cstr); - VString* param=s?new VString(*new String(s)):0; + String::Body param_body("/"); + if(s) + param_body.append_know_length(s, strlen(s)); + + VString* vparam=new VString(*new String(param_body, String::L_TAINTED)); { Temp_lang temp_lang(r, String::L_XML); // default language: XML Request::Execute_nonvirtual_method_result body= - r.execute_nonvirtual_method(r.main_class, *method, param, true); + r.execute_nonvirtual_method(r.main_class, *method, vparam, true); if(body.string) { MemoryStream *stream=new(UseGC) MemoryStream; stream->m_buf=body.string->cstr(String::L_UNSPECIFIED); @@ -156,12 +158,6 @@ pa_xmlFileReadMethod (void * context, // return stream.read(buffer, len); } -/** - * xmlFileClose: - * @context: the I/O context - * - * Close an I/O channel - */ static int pa_xmlFileCloseMethod (void * /*context*/) { return 0; @@ -175,7 +171,7 @@ void pa_xml_io_init() { xmlFileMatchLocalhost, xmlFileOpenLocalhost, pa_xmlFileRead, pa_xmlFileClose); - // parser://method/param/here -> ^/abc | ./abc + // parser://method/param/here -> ^MAIN:method[/params/here] xmlRegisterInputCallbacks( xmlFileMatchMethod, xmlFileOpenMethod, pa_xmlFileReadMethod, pa_xmlFileCloseMethod);