2 * ----------------------------------------------------------------------
11 let error_happened = ref false;;
13 let rec prerr_error e =
14 prerr_endline (string_of_exn e)
20 prerr_endline ("WARNING: " ^ w)
24 let parse_and_write in_filename =
26 let e = new element_impl default_extension in
27 make_spec_from_mapping
28 ~super_root_exemplar: e
29 ~default_pinstr_exemplar: e
30 ~data_exemplar: (new data_impl default_extension)
31 ~default_element_exemplar: e
32 ~element_mapping: (Hashtbl.create 1)
38 enable_pinstr_nodes = true;
39 enable_super_root_node = true;
47 (from_file in_filename)
51 tree # write (Out_channel stdout) `Enc_utf8;
54 error_happened := true;
60 let in_file = ref "" in
62 [ "-in", (Arg.String (fun s -> in_file := s)),
63 " <file> Set the XML file to read";
65 (fun x -> raise (Arg.Bad "Unexpected argument"))
67 usage: test_write [ options ]
70 if !in_file = "" then begin
71 prerr_endline "No input file specified.";
74 parse_and_write !in_file
79 if !error_happened then exit(1);;
81 (* ======================================================================
85 * Revision 1.1 2000/11/17 09:57:35 lpadovan
88 * Revision 1.2 2000/08/16 23:44:21 gerd
89 * Updates because of changes of the PXP API.
91 * Revision 1.1 2000/07/16 17:50:39 gerd