2 * ----------------------------------------------------------------------
11 let rec print_error e =
12 prerr_endline(string_of_exn e)
22 let convert_to_html filename =
23 (* read in style definition *)
26 { default_config with encoding = `Enc_iso88591 }
30 let root = document # root in
31 let store = new To_html.store in
32 root # extension # to_html store stdout
36 let convert_to_text filename =
37 (* read in style definition *)
44 let root = document # root in
45 let store = new To_text.store in
46 let box = new To_text.box 79 79 in
47 root # extension # to_box store box;
48 box # output 0 0 stdout
53 let want_html = ref false in
54 let want_text = ref false in
55 let filename = ref None in
57 [ "-html", Arg.Set want_html,
58 " convert file to html";
59 "-text", Arg.Set want_text,
60 " convert file to text";
64 None -> filename := Some s
66 raise (Arg.Bad "Multiple arguments not allowed."))
67 "usage: readme [ -text | -html ] input.xml >output";
71 prerr_endline "readme: no input";
75 match !want_html, !want_text with
77 run convert_to_html fn
79 run convert_to_text fn
81 prerr_endline ("readme: Please select exactly one output format")
86 (* ======================================================================
90 * Revision 1.1 2000/11/17 09:57:31 lpadovan
93 * Revision 1.5 2000/07/08 17:58:17 gerd
94 * Updated because of PXP API changes.
96 * Revision 1.4 2000/06/04 20:25:38 gerd
97 * Updates because of renamed PXP modules.
99 * Revision 1.3 2000/05/01 16:46:40 gerd
100 * Using the new error formatter.
102 * Revision 1.2 1999/08/23 16:54:19 gerd
105 * Revision 1.1 1999/08/22 22:29:32 gerd