From 6c555e40c353451ae479b8be5a31f67517682122 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Fri, 29 Nov 2002 11:38:49 +0000 Subject: [PATCH] snapshot Fri, 29 Nov 2002 12:38:23 +0100 zack --- helm/uwobo/src/ocaml/uwobo.ml | 6 ++++-- helm/uwobo/src/ocaml/uwobo_engine.ml | 14 ++++++++------ helm/uwobo/src/ocaml/uwobo_engine.mli | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/helm/uwobo/src/ocaml/uwobo.ml b/helm/uwobo/src/ocaml/uwobo.ml index 334255b40..4584e0910 100644 --- a/helm/uwobo/src/ocaml/uwobo.ml +++ b/helm/uwobo/src/ocaml/uwobo.ml @@ -159,11 +159,13 @@ let callback req outchan = syslogger#log `Debug (sprintf "Parsing input document %s ..." xmluri); let domImpl = Gdome.domImplementation () in let input = domImpl#createDocumentFromURI ~uri:xmluri () in + syslogger#log `Debug "Applying stylesheet chain ..."; let output = - Uwobo_engine.apply ~logger ~styles ~keys ~input ~params ~props + Uwobo_engine.apply + ~logger:syslogger ~styles ~keys ~input ~params ~props (* TODO uhm ... what to do if Uwobo_failure is raised? *) in - syslogger#log `Debug logger#asText; +(* syslogger#log `Debug logger#asText; *) let tempfile = (* temporary file on which save XML output *) (* TODO I don't need a tempfile, but gdome seems not to permit to return the string representation of a Gdome.document *) diff --git a/helm/uwobo/src/ocaml/uwobo_engine.ml b/helm/uwobo/src/ocaml/uwobo_engine.ml index 9e4850bbb..bda9b1804 100644 --- a/helm/uwobo/src/ocaml/uwobo_engine.ml +++ b/helm/uwobo/src/ocaml/uwobo_engine.ml @@ -29,7 +29,6 @@ open Uwobo_common;; let dump_args keys params props = (sprintf " -

Uwobo_engine.apply: not yet implemented!

Keys: %s
Parameters:
%s @@ -55,17 +54,20 @@ Props: %s
(* TODO add global mutex, stylesheets are freezed at the request moment *) let apply - ~(logger: Uwobo_logger.processingLogger) + ~(logger: Uwobo_logger.sysLogger) ~(styles: Uwobo_styles.styles) ~keys ~params ~props ~input = let stylesheets = styles#get keys in - logger#log (dump_args keys params props); - logger#log "Creating input document ..."; + logger#log `Debug (dump_args keys params props); + logger#log `Debug "Creating input document ..."; List.fold_left (fun source (key, stylesheet) -> - logger#log (sprintf "Applying stylesheet %s ..." key); + logger#log `Debug (sprintf "Applying stylesheet %s ..." key); try - Gdome_xslt.applyStylesheet ~source ~stylesheet ~params:(params key) + let params = + List.map (fun (key,value) -> (key, "'" ^ value ^ "'")) (params key) + in + Gdome_xslt.applyStylesheet ~source ~stylesheet ~params with e -> raise (Uwobo_failure (Printexc.to_string e))) input stylesheets diff --git a/helm/uwobo/src/ocaml/uwobo_engine.mli b/helm/uwobo/src/ocaml/uwobo_engine.mli index 378375fa6..bf18e6308 100644 --- a/helm/uwobo/src/ocaml/uwobo_engine.mli +++ b/helm/uwobo/src/ocaml/uwobo_engine.mli @@ -34,7 +34,7 @@ @param channel on which write final output *) val apply: - logger: Uwobo_logger.processingLogger -> + logger: Uwobo_logger.sysLogger -> styles: Uwobo_styles.styles -> keys: string list -> params: (string -> (string * string) list) -> -- 2.39.2