X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Fpxp%2Fpxp%2Frtests%2Fwrite%2Ftest_write.ml;fp=helm%2FDEVEL%2Fpxp%2Fpxp%2Frtests%2Fwrite%2Ftest_write.ml;h=0000000000000000000000000000000000000000;hb=c7514aaa249a96c5fdd39b1123fbdb38d92f20b6;hp=48defd2a17ec1339fef0191cfa94493a740f83b6;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff;p=helm.git diff --git a/helm/DEVEL/pxp/pxp/rtests/write/test_write.ml b/helm/DEVEL/pxp/pxp/rtests/write/test_write.ml deleted file mode 100644 index 48defd2a1..000000000 --- a/helm/DEVEL/pxp/pxp/rtests/write/test_write.ml +++ /dev/null @@ -1,94 +0,0 @@ -(* $Id$ - * ---------------------------------------------------------------------- - * - *) - - -open Pxp_document;; -open Pxp_yacc;; -open Pxp_types;; - -let error_happened = ref false;; - -let rec prerr_error e = - prerr_endline (string_of_exn e) -;; - -class warner = - object - method warn w = - prerr_endline ("WARNING: " ^ w) - end -;; - -let parse_and_write in_filename = - let spec = - let e = new element_impl default_extension in - make_spec_from_mapping - ~super_root_exemplar: e - ~default_pinstr_exemplar: e - ~data_exemplar: (new data_impl default_extension) - ~default_element_exemplar: e - ~element_mapping: (Hashtbl.create 1) - () - in - let config = - { default_config with - warner = new warner; - enable_pinstr_nodes = true; - enable_super_root_node = true; - encoding = `Enc_utf8; - } - in - try - let tree = - parse_document_entity - config - (from_file in_filename) - spec - in - - tree # write (Out_channel stdout) `Enc_utf8; - with - e -> - error_happened := true; - prerr_error e -;; - - -let main() = - let in_file = ref "" in - Arg.parse - [ "-in", (Arg.String (fun s -> in_file := s)), - " Set the XML file to read"; - ] - (fun x -> raise (Arg.Bad "Unexpected argument")) - " -usage: test_write [ options ] - -List of options:"; - if !in_file = "" then begin - prerr_endline "No input file specified."; - exit 1 - end; - parse_and_write !in_file -;; - - -main(); -if !error_happened then exit(1);; - -(* ====================================================================== - * History: - * - * $Log$ - * Revision 1.1 2000/11/17 09:57:35 lpadovan - * Initial revision - * - * Revision 1.2 2000/08/16 23:44:21 gerd - * Updates because of changes of the PXP API. - * - * Revision 1.1 2000/07/16 17:50:39 gerd - * Initial revision. - * - *)