--- parser3/src/classes/xdoc.C 2002/06/28 09:59:00 1.95 +++ parser3/src/classes/xdoc.C 2002/08/15 09:07:49 1.98 @@ -3,12 +3,13 @@ Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) - - $Id: xdoc.C,v 1.95 2002/06/28 09:59:00 paf Exp $ */ + #include "classes.h" #ifdef XML +static const char* IDENT_XDOC_C="$Date: 2002/08/15 09:07:49 $"; + #include "pa_stylesheet_connection.h" #include "pa_request.h" #include "pa_vxdoc.h" @@ -726,9 +727,9 @@ static void _transform(Request& r, const VXdoc *result; Value& vmaybe_xdoc=params->get(0); - if(strcmp(vmaybe_xdoc.type(), VXDOC_TYPE)==0) { // stylesheet (xdoc) + if(Value *vxdoc=vmaybe_xdoc.as(VXDOC_TYPE, false)) { // stylesheet (xdoc) xmlDoc *document=gdome_xml_doc_get_xmlDoc( - static_cast(&vmaybe_xdoc)->get_document(&method_name)); + static_cast(vxdoc)->get_document(&method_name)); // compile xdoc stylesheet xsltStylesheet_auto_ptr stylesheet_ptr(xsltParseStylesheetDoc(document)); // strange thing - xsltParseStylesheetDoc records document and destroys it in stylesheet destructor @@ -819,8 +820,8 @@ MXdoc::MXdoc(Pool& apool) : MXnode(apool // ^xdoc.file[options hash] file with "" add_native_method("file", Method::CT_DYNAMIC, _file, 0, 1); - // ^xdoc.transform[stylesheet file_name] - // ^xdoc.transform[stylesheet file_name;params hash] + // ^xdoc.transform[stylesheet file_name/xdoc] + // ^xdoc.transform[stylesheet file_name/xdoc;params hash] add_native_method("transform", Method::CT_DYNAMIC, _transform, 1, 2); }