From: Stefano Zacchiroli Date: Sun, 1 Dec 2002 20:03:59 +0000 (+0000) Subject: - bugfix: add xsl:output element as last child of the root element to X-Git-Tag: V_0_0_6~24 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=e5de7dd8a5252e83ba067e638a847bcdeaffde4b;p=helm.git - bugfix: add xsl:output element as last child of the root element to avoid violation of XSLT specifications when one or more xsl:import elements are used - added logging of received parameters for debugging purposes --- diff --git a/helm/uwobo/src/ocaml/uwobo_engine.ml b/helm/uwobo/src/ocaml/uwobo_engine.ml index 66a6ca7ce..fcbc0f364 100644 --- a/helm/uwobo/src/ocaml/uwobo_engine.ml +++ b/helm/uwobo/src/ocaml/uwobo_engine.ml @@ -86,7 +86,7 @@ let apply_properties logger last_stylesheet props = logger#log `Debug "Creating xsl:output node ..."; let elt = last_stylesheet#createElementNS (Some xslNS) q_outputS in let root = last_stylesheet#get_documentElement in - ignore (root#insertBefore (elt :> Gdome.node) root#get_firstChild); + ignore (root#appendChild (elt :> Gdome.node)); elt | Some node -> new Gdome.element_of_node node) in @@ -134,7 +134,13 @@ let apply let params = List.map (fun (key,value) -> (key, "'" ^ value ^ "'")) (params key) in - Gdome_xslt.applyStylesheet ~source ~stylesheet ~params + logger#log + `Debug + (sprintf + "Gdome_xslt.applyStylesheet params=%s" + (String.concat ", " (List.map (fun (k,v) -> k^": "^v) params))); + let res = Gdome_xslt.applyStylesheet ~source ~stylesheet ~params in + res with e -> raise (Uwobo_failure (Printexc.to_string e))) input p_stylesheets