--- parser3/src/classes/xdoc.C 2002/04/09 15:27:13 1.89 +++ parser3/src/classes/xdoc.C 2002/04/18 15:54:39 1.92 @@ -4,7 +4,7 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - $Id: xdoc.C,v 1.89 2002/04/09 15:27:13 paf Exp $ + $Id: xdoc.C,v 1.92 2002/04/18 15:54:39 paf Exp $ */ #include "classes.h" #ifdef XML @@ -25,6 +25,7 @@ extern "C" { #include "libxslt/xsltInternals.h" #include "libxslt/transform.h" #include "libxslt/xsltutils.h" +#include "libxslt/variables.h" // defines @@ -45,7 +46,6 @@ public: MXdoc(Pool& pool); public: // Methoded - bool used_directly() { return true; } void configure_admin(Request& r); }; @@ -342,7 +342,7 @@ static void _create(Request& r, const St GdomeDocument *document; if(param.get_junction()) { // {} Temp_lang temp_lang(r, String::UL_XML); - const String& xml=r.process(param).as_string(); + const String& xml=r.process_to_string(param); const char *cstr=xml.cstr(String::UL_UNSPECIFIED); document=(GdomeDocument *) @@ -655,15 +655,20 @@ static void _transform(Request& r, const const String& stylesheet_filespec=r.absolute(params->as_string(0, "file name must be string")); Stylesheet_connection_ptr connection=stylesheet_manager->get_connection(stylesheet_filespec); - // transform + // prepare to transform xsltStylesheet *stylesheet=connection->stylesheet(false/*nocache*/); xmlDoc *document=gdome_xml_doc_get_xmlDoc(vdoc.get_document(&method_name)); xsltTransformContext_auto_ptr transformContext( xsltNewTransformContext(stylesheet, document)); + // make params literal + if (transformContext->globalVars == NULL) // strangly not initialized by xsltNewTransformContext + transformContext->globalVars = xmlHashCreate(20); + xsltQuoteUserParams(transformContext.get(), transform_params); + // do transform xmlDoc *transformed=xsltApplyStylesheetUser( stylesheet, document, - transform_params, + 0/*already quoted-inserted transform_params*/, 0/*const char *output*/, 0/*FILE *profile*/, transformContext.get()); @@ -717,11 +722,8 @@ static void _transform(Request& r, const // constructor -MXdoc::MXdoc(Pool& apool) : MXnode(apool) { - set_name(*NEW String(pool(), XDOC_CLASS_NAME)); - - /// @test how to create empty type html? - +/// @test how to create empty type html? +MXdoc::MXdoc(Pool& apool) : MXnode(apool, XDOC_CLASS_NAME, Xnode_class) { /// DOM1 // Element createElement(in DOMString tagName) raises(DOMException);