--- parser3/src/classes/Attic/dom.C 2001/09/21 09:04:18 1.32 +++ parser3/src/classes/Attic/dom.C 2001/09/26 10:32:25 1.35 @@ -2,12 +2,13 @@ Parser: @b dom parser class. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) - Author: Alexander Petrosyan (http://design.ru/paf) -*/ -static const char *RCSId="$Id: dom.C,v 1.32 2001/09/21 09:04:18 parser Exp $"; + $Id: dom.C,v 1.35 2001/09/26 10:32:25 parser Exp $ +*/ #include "classes.h" +#ifdef XML + #include "pa_request.h" #include "pa_vdom.h" #include "pa_xslt_stylesheet_manager.h" @@ -66,7 +67,7 @@ protected: // XalanOutputStream virtual void writeData(const char *theBuffer, unsigned long theBufferLength) { char *copy=(char *)fstring.malloc((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() {} @@ -240,7 +241,7 @@ static void _set(Request& r, const Strin const String& xml=r.process(vxml).as_string(); std::istrstream stream(xml.cstr()); - XalanParsedSource* parsedSource; + const XalanParsedSource* parsedSource; int error=vdom.transformer().parseSource(&stream, parsedSource); if(error) @@ -260,7 +261,7 @@ static void _load(Request& r, const Stri 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); - XalanParsedSource* parsedSource; + const XalanParsedSource* parsedSource; int error=vdom.transformer().parseSource(filespec, parsedSource); if(error) @@ -299,7 +300,7 @@ static void _xslt(Request& r, const Stri } // source - XalanParsedSource &parsed_source=vdom.get_parsed_source(pool, &method_name); + const XalanParsedSource &parsed_source=vdom.get_parsed_source(pool, &method_name); // stylesheet const String& stylesheet_file_name=params->as_string(0, "file name must not be code"); @@ -362,6 +363,14 @@ Methoded *Dom_class; // creator +#endif + Methoded *MDom_create(Pool& pool) { - return Dom_class=new(pool) MDom(pool); + return +#ifdef XML + Dom_class=new(pool) MDom(pool); +#else + 0 +#endif + ; }