--- parser3/src/classes/Attic/dom.C 2001/09/15 14:22:47 1.22 +++ parser3/src/classes/Attic/dom.C 2001/09/17 16:49:15 1.24 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: dom.C,v 1.22 2001/09/15 14:22:47 parser Exp $"; +static const char *RCSId="$Id: dom.C,v 1.24 2001/09/17 16:49:15 parser Exp $"; #if _MSC_VER # pragma warning(disable:4291) // disable warning @@ -18,11 +18,11 @@ static const char *RCSId="$Id: dom.C,v 1 #include "pa_vfile.h" #include "pa_xslt_stylesheet_manager.h" #include "pa_stylesheet_connection.h" +#include "dnode.h" #include #include #include -#include #include #include #include @@ -48,7 +48,7 @@ static const char *RCSId="$Id: dom.C,v 1 // class -class MDom : public Methoded { +class MDom : public MDnode { public: // VStateless_class Value *create_new_value(Pool& pool) { return new(pool) VDom(pool); } @@ -102,31 +102,6 @@ static void _load(Request& r, const Stri vDom.set_parsed_source(*parsedSource); } -static const char *strX(const XalanDOMString& s) { - return XMLString::transcode(s.c_str()); -} - -static void _throw(Pool& pool, const String *source, const XSLException& e) { - if(e.getURI().empty()) - PTHROW(0, 0, - source, - "%s (%s)", - strX(e.getMessage()), // message for exception - strX(e.getType()) // type of exception - ); - else - PTHROW(0, 0, - source, - "%s (%s) %s(%d:%d)'", - strX(e.getMessage()), // message for exception - strX(e.getType()), // type of exception - - strX(e.getURI()), // URI for the associated document, if any - e.getLineNumber(), // line number, or -1 if unknown - e.getColumnNumber() // column number, or -1 if unknown - ); -} - class ParserStringXalanOutputStream: public XalanOutputStream { public: @@ -308,8 +283,8 @@ static void add_xslt_param(const Hash::K const char *meaning_cstr=static_cast(ameaning)->as_string().cstr(); transformer.setStylesheetParam( - XalanDOMString(attribute_cstr, strlen(attribute_cstr)), - XalanDOMString(meaning_cstr, strlen(meaning_cstr))); + XalanDOMString(attribute_cstr), + XalanDOMString(meaning_cstr)); } static void _xslt(Request& r, const String& method_name, MethodParams *params) { Pool& pool=r.pool(); @@ -359,7 +334,7 @@ static void _xslt(Request& r, const Stri // constructor -MDom::MDom(Pool& apool) : Methoded(apool) { +MDom::MDom(Pool& apool) : MDnode(apool) { set_name(*NEW String(pool(), DOM_CLASS_NAME)); // ^dom::set[xml] @@ -389,10 +364,5 @@ Methoded *Dom_class; // creator Methoded *MDom_create(Pool& pool) { - // Use the static initializers to initialize the Xalan-C++ and Xerces-C++ platforms. - // You must initialize Xerces-C++ once per process - XMLPlatformUtils::Initialize(); - XalanTransformer::initialize(); - return Dom_class=new(pool) MDom(pool); }