--- parser3/src/classes/xdoc.C 2015/04/06 22:27:25 1.181 +++ parser3/src/classes/xdoc.C 2016/04/11 22:58:57 1.186 @@ -1,7 +1,7 @@ /** @file Parser: @b xdoc parser class. - Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) + Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -28,7 +28,7 @@ #include "xnode.h" #include "pa_charsets.h" -volatile const char * IDENT_XDOC_C="$Id: xdoc.C,v 1.181 2015/04/06 22:27:25 moko Exp $"; +volatile const char * IDENT_XDOC_C="$Id: xdoc.C,v 1.186 2016/04/11 22:58:57 moko Exp $"; // defines @@ -47,7 +47,8 @@ public: // global variable -DECLARE_CLASS_VAR(xdoc, new MXdoc, 0); +DECLARE_CLASS_VAR(xnode, new MXnode); // must be here as Xdoc is inherited from Xnode and should be inited before +DECLARE_CLASS_VAR(xdoc, new MXdoc); // helper classes @@ -564,12 +565,8 @@ static void _file(Request& r, MethodPara VFile& vfile=*new VFile; VHash& vhcontent_type=*new VHash; - vhcontent_type.hash().put( - value_name, - new VString(*oo.mediaType)); - vhcontent_type.hash().put( - String::Body("charset"), - new VString(*oo.encoding)); + vhcontent_type.hash().put(value_name, new VString(*oo.mediaType)); + vhcontent_type.hash().put("charset", new VString(*oo.encoding)); vfile.set_binary(false/*not tainted*/, buf.str?buf.str:""/*to distinguish from stat-ed file*/, buf.length, oo.filename, &vhcontent_type); @@ -726,7 +723,9 @@ static void _transform(Request& r, Metho // constructor /// @test how to create empty type html? -MXdoc::MXdoc(): MXnode(XDOC_CLASS_NAME, xnode_class) { +MXdoc::MXdoc(): MXnode(XDOC_CLASS_NAME) { + set_base(xnode_class); + /// DOM1 // Element createElement(in DOMString tagName) raises(DOMException); @@ -796,6 +795,7 @@ MXdoc::MXdoc(): MXnode(XDOC_CLASS_NAME, // global variable -DECLARE_CLASS_VAR(xdoc, 0, 0); // fictive +DECLARE_CLASS_VAR(xnode, 0); // fictive +DECLARE_CLASS_VAR(xdoc, 0); // fictive #endif