]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/common/library.ml
xml: bug fix
[helm.git] / helm / software / lambda-delta / common / library.ml
index 8ef875ce780526e34453956adefd1b2d55890cee..1238c273986b760d9af759a564902d6e5b18b7f7 100644 (file)
@@ -13,6 +13,8 @@ module F = Filename
 module U = NUri
 module H = Hierarchy
 
+type 'a out = (unit -> 'a) -> string -> 'a
+
 (* internal functions *******************************************************)
 
 let base = "xml"
@@ -42,7 +44,7 @@ let close_entry frm =
 
 (* interface functions ******************************************************)
 
-let export_entity export_entry si g = function
+let old_export_entity export_entry si g = function
    | Some entry ->
       let _, uri, bind = entry in
       let path = path_of_uri uri in
@@ -54,3 +56,20 @@ let export_entity export_entry si g = function
          pp_head pp_doctype (open_entry si g) export_entry entry close_entry;  
       close_out och
    | None     -> ()
+
+(****************************************************************************)
+(*
+let export_entity export_entry si g = function
+   | Some entry ->
+      let _, uri, bind = entry in
+      let path = path_of_uri root uri in
+      let _ = Sys.command (Printf.sprintf "mkdir -p %s" (F.dirname path)) in
+      let och = open_out (path ^ obj_ext) in
+      let out f s = output_string och s; f () in
+      let f () = close_out och in
+      
+      Format.fprintf frm "@[<v>%t%t%t%a%t@]@." 
+         pp_head pp_doctype (open_entry si g) export_entry entry close_entry;  
+      close_out och
+   | None     -> ()
+*)