]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/uwobo/src/ocaml/uwobo_styles.ml
snapshot Fri, 29 Nov 2002 17:17:46 +0100 zack
[helm.git] / helm / uwobo / src / ocaml / uwobo_styles.ml
index 93fdb8e6330263c9d45618da314bf10dab63caf5..b402987800bb6c51940197f1aa713c70ec4af015 100644 (file)
@@ -40,16 +40,26 @@ class styles =
     val domImpl = Gdome.domImplementation ()
 
       (** process an XSLT stylesheet *)
-    method private process uri =
-      Gdome_xslt.processStylesheet (domImpl#createDocumentFromURI ~uri ())
+    method private process uri = domImpl#createDocumentFromURI ~uri ()
 
     method get keys =
       self#doReader (lazy (
-        List.fold_left
-          (fun collected_styles key ->
-            (List.find (fun (k, _) -> k = key) stylesheets)::collected_styles)
-          []
-          (List.rev keys)
+        let rev_keys = List.rev keys in
+        let last_key = List.hd rev_keys in
+        let p_stylesheets =
+          List.fold_left
+            (fun collected_styles key ->
+              let (key, stylesheet) =
+                List.find (fun (k, _) -> k = key) stylesheets
+              in
+              (key, Gdome_xslt.processStylesheet stylesheet)::collected_styles)
+            []
+            rev_keys
+        in
+        let last_stylesheet =
+          snd (List.find (fun (k, _) -> k = last_key) stylesheets)
+        in
+        (p_stylesheets, last_stylesheet)
       ))
 
     method add key uri =