|
|
| version 1.33, 2001/09/21 14:46:09 | version 1.35, 2001/09/26 10:32:25 |
|---|---|
| Line 2 | Line 2 |
| Parser: @b dom parser class. | Parser: @b dom parser class. |
| Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf) | Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf) |
| $Id$ | |
| */ | */ |
| #include "classes.h" | #include "classes.h" |
| #ifdef XML | #ifdef XML |
| static const char *RCSId="$Id$"; | |
| #include "pa_request.h" | #include "pa_request.h" |
| #include "pa_vdom.h" | #include "pa_vdom.h" |
| #include "pa_xslt_stylesheet_manager.h" | #include "pa_xslt_stylesheet_manager.h" |
| Line 68 protected: // XalanOutputStream | Line 67 protected: // XalanOutputStream |
| virtual void writeData(const char *theBuffer, unsigned long theBufferLength) { | virtual void writeData(const char *theBuffer, unsigned long theBufferLength) { |
| char *copy=(char *)fstring.malloc((size_t)theBufferLength); | char *copy=(char *)fstring.malloc((size_t)theBufferLength); |
| memcpy(copy, theBuffer, (size_t)theBufferLength); | memcpy(copy, theBuffer, (size_t)theBufferLength); |
| fstring.APPEND_CLEAN(copy, (size_t)theBufferLength, "dom", -1); | fstring.APPEND_CLEAN(copy, (size_t)theBufferLength, "dom", 0); |
| } | } |
| virtual void doFlush() {} | virtual void doFlush() {} |
| Line 242 static void _set(Request& r, const Strin | Line 241 static void _set(Request& r, const Strin |
| const String& xml=r.process(vxml).as_string(); | const String& xml=r.process(vxml).as_string(); |
| std::istrstream stream(xml.cstr()); | std::istrstream stream(xml.cstr()); |
| XalanParsedSource* parsedSource; | const XalanParsedSource* parsedSource; |
| int error=vdom.transformer().parseSource(&stream, parsedSource); | int error=vdom.transformer().parseSource(&stream, parsedSource); |
| if(error) | if(error) |
| Line 262 static void _load(Request& r, const Stri | Line 261 static void _load(Request& r, const Stri |
| const String& file_name=params->as_string(0, "file name must not be code"); | const String& file_name=params->as_string(0, "file name must not be code"); |
| const char *filespec=r.absolute(file_name).cstr(String::UL_FILE_SPEC); | const char *filespec=r.absolute(file_name).cstr(String::UL_FILE_SPEC); |
| XalanParsedSource* parsedSource; | const XalanParsedSource* parsedSource; |
| int error=vdom.transformer().parseSource(filespec, parsedSource); | int error=vdom.transformer().parseSource(filespec, parsedSource); |
| if(error) | if(error) |
| Line 301 static void _xslt(Request& r, const Stri | Line 300 static void _xslt(Request& r, const Stri |
| } | } |
| // source | // source |
| XalanParsedSource &parsed_source=vdom.get_parsed_source(pool, &method_name); | const XalanParsedSource &parsed_source=vdom.get_parsed_source(pool, &method_name); |
| // stylesheet | // stylesheet |
| const String& stylesheet_file_name=params->as_string(0, "file name must not be code"); | const String& stylesheet_file_name=params->as_string(0, "file name must not be code"); |