From de0d7bddcaaafdf3ebf6ce9a632ab65bfd7e6910 Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Mon, 23 Jun 2008 13:12:34 +0000 Subject: [PATCH] stylesheet application moved after header send --- helm/software/daemons/uwobo/Makefile | 2 +- helm/software/daemons/uwobo/uwobo.ml | 2 +- helm/software/daemons/uwobo/uwobo_engine.ml | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/helm/software/daemons/uwobo/Makefile b/helm/software/daemons/uwobo/Makefile index 40434ed49..29e1f352b 100644 --- a/helm/software/daemons/uwobo/Makefile +++ b/helm/software/daemons/uwobo/Makefile @@ -2,7 +2,7 @@ VERSION = 0.3.0 DISTDIR = uwobo-$(VERSION) DISTTARBALL = $(DISTDIR).tar.gz REQUIRES = http gdome2 gdome2-xslt pcre unix helm-registry -COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o +COMMONOPTS = -package "$(REQUIRES)" -pp camlp4o -rectypes ifeq ($(origin OCAMLPATH), undefined) OCAMLFIND = OCAMLPATH=../../components/METAS ocamlfind else diff --git a/helm/software/daemons/uwobo/uwobo.ml b/helm/software/daemons/uwobo/uwobo.ml index e7aa1e8f9..fc2d5d02b 100644 --- a/helm/software/daemons/uwobo/uwobo.ml +++ b/helm/software/daemons/uwobo/uwobo.ml @@ -481,7 +481,7 @@ let callback let xmluri = req#param "xmluri" in let keys = Pcre.split ~pat:"," (req#param "keys") in (* notation: "local" parameters are those defined on a per-stylesheet - pasis (i.e. param.key.param=value), "global" parameters are those + basis (i.e. param.key.param=value), "global" parameters are those defined for all stylesheets (i.e. param.param=value) *) let (user_params, props) = parse_apply_params req#params in let profile_params = diff --git a/helm/software/daemons/uwobo/uwobo_engine.ml b/helm/software/daemons/uwobo/uwobo_engine.ml index 03a3b424d..f0b8b9722 100644 --- a/helm/software/daemons/uwobo/uwobo_engine.ml +++ b/helm/software/daemons/uwobo/uwobo_engine.ml @@ -202,7 +202,7 @@ let apply let (p_stylesheets,last_stylesheet) = styles#get keys props logger in logger#log `Debug "Creating input document ..."; let intermediate_results_seqno = ref 0 in - let result = (* Gdome.document *) + let result () = (* Gdome.document *) List.fold_left (fun source (key, stylesheet) -> logger#log `Debug (sprintf "Applying stylesheet %s ..." key); @@ -245,8 +245,11 @@ let apply input p_stylesheets in + let p_last_stylesheet = snd (List.hd (List.rev p_stylesheets)) in + ((fun outchan -> (* serialization function *) + let result = result () in (* add error and debugging messages to result document *) - add_msgs ~errormode ~debugmode ~msgs:veillogger#msgs result; + add_msgs ~errormode ~debugmode ~msgs:veillogger#msgs result; (* (* DEBUGGING *) add_msgs @@ -254,10 +257,7 @@ let apply ~msgs:[LibXsltErrorMsg "error1"; LibXsltDebugMsg "debug1"] result; *) - let p_last_stylesheet = snd (List.hd (List.rev p_stylesheets)) in - ((fun outchan -> (* serialization function *) Gdome_xslt.saveResultToChannel ~outchan ~result ~stylesheet:p_last_stylesheet), (get_property "media-type" last_stylesheet), (* media-type *) (get_property "encoding" last_stylesheet)) (* encoding *) - -- 2.39.2