]> matita.cs.unibo.it Git - helm.git/commitdiff
changed debugging code which saves xml input document and input uri so
authorStefano Zacchiroli <zack@upsilon.cc>
Thu, 19 May 2005 10:00:16 +0000 (10:00 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Thu, 19 May 2005 10:00:16 +0000 (10:00 +0000)
that it is automatically enabled with debugging

helm/uwobo/uwobo.ml

index ec5cc52031656979f986efa852d6d654a1dc1090..1a5b44f620264f3c862bc09f3759b25c68dd311c 100644 (file)
@@ -517,10 +517,18 @@ let callback
         syslogger#log `Debug (sprintf "Parsing input document %s ..." xmluri);
         let domImpl = Gdome.domImplementation () in
         let input = domImpl#createDocumentFromURI ~uri:xmluri () in
-(*
-let _ = domImpl#saveDocumentToFile ~doc:input ~name:"/tmp/uwobo_doc.xml" () in
-let _ = let oc = open_out "/tmp/uwobo_uri.txt" in output_string oc xmluri; close_out oc in
-*)
+        if debug then begin
+          let tmp_xml, tmp_uri =
+            let dir =
+              Filename.dirname (Helm_registry.get "uwobo.log_basename")
+            in
+            dir ^ "/input.xml", dir ^ "/input.uri"
+          in
+          ignore (domImpl#saveDocumentToFile ~doc:input ~name:tmp_xml ());
+          let oc = open_out tmp_uri in
+          output_string oc xmluri;
+          close_out oc
+        end;
         syslogger#log `Debug "Applying stylesheet chain ...";
         (try
           let (write_result, media_type, encoding) = (* out_channel -> unit *)