]> matita.cs.unibo.it Git - helm.git/commitdiff
snapshot Fri, 29 Nov 2002 12:38:23 +0100 zack
authorStefano Zacchiroli <zack@upsilon.cc>
Fri, 29 Nov 2002 11:38:49 +0000 (11:38 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Fri, 29 Nov 2002 11:38:49 +0000 (11:38 +0000)
helm/uwobo/src/ocaml/uwobo.ml
helm/uwobo/src/ocaml/uwobo_engine.ml
helm/uwobo/src/ocaml/uwobo_engine.mli

index 334255b408e69d60414908bbdeb51dd442c010ef..4584e091044298e3cc1c4261c18d165fb1d7df05 100644 (file)
@@ -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 *)
index 9e4850bbb6a3b35c5b617b50ebca37715c1f051f..bda9b1804e9a7f1ba550d0ca23649d61b6a193c5 100644 (file)
@@ -29,7 +29,6 @@ open Uwobo_common;;
 
 let dump_args keys params props =
   (sprintf "
-<h1>Uwobo_engine.apply: not yet implemented!</h1>
 Keys: %s<br />
 Parameters:<br />
 %s
@@ -55,17 +54,20 @@ Props: %s<br />
 
   (* 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
index 378375fa6abd3ad2739c0d2a80fe68525afd2be2..bf18e63083119fe828fb73f0a04a267bd75844d9 100644 (file)
@@ -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) ->