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 *)
let dump_args keys params props =
(sprintf "
-<h1>Uwobo_engine.apply: not yet implemented!</h1>
Keys: %s<br />
Parameters:<br />
%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
@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) ->