2 (* Copyright (C) 2002, HELM Team.
4 * This file is part of HELM, an Hypertextual, Electronic
5 * Library of Mathematics, developed at the Computer Science
6 * Department, University of Bologna, Italy.
8 * HELM is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
13 * HELM is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with HELM; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
23 * For details, see the HELM World-Wide-Web page,
24 * http://cs.unibo.it/helm/.
30 let dump_args keys params props =
37 (String.concat ", " keys)
48 (fun (key,value) -> sprintf "%s:%s" key value)
53 (List.map (fun (key,value) -> sprintf "%s:%s" key value) props)))
55 (* TODO add global mutex, stylesheets are freezed at the request moment *)
57 ~(logger: Uwobo_logger.sysLogger)
58 ~(styles: Uwobo_styles.styles)
59 ~keys ~params ~props ~input =
60 let stylesheets = styles#get keys in
61 logger#log `Debug (dump_args keys params props);
62 logger#log `Debug "Creating input document ...";
64 (fun source (key, stylesheet) ->
65 logger#log `Debug (sprintf "Applying stylesheet %s ..." key);
68 List.map (fun (key,value) -> (key, "'" ^ value ^ "'")) (params key)
70 Gdome_xslt.applyStylesheet ~source ~stylesheet ~params
71 with e -> raise (Uwobo_failure (Printexc.to_string e)))