2 * ----------------------------------------------------------------------
6 (* Read a record-list, delete a column, and print it as XML *)
15 match n # node_type with
16 T_element name when name = col ->
18 | _ -> n # orphaned_flat_clone)
24 let column = ref "" in
26 [ "-col", Arg.String (fun s -> column := s),
27 " (last-name|first-name|phone)";
29 (fun _ -> raise (Arg.Bad "Bad usage"))
30 "usage: sort [ options ]";
31 if !column = "" then (
32 prerr_endline "Column not specified!";
35 if not(List.mem !column ["last-name"; "first-name"; "phone"]) then (
36 prerr_endline ("Unknown column: " ^ !column);
40 let dtd = parse_dtd_entity default_config (from_file "record.dtd") in
42 parse_content_entity default_config (from_channel stdin) dtd default_spec
44 print_endline "<?xml encoding='ISO-8859-1'?>";
45 (delcol !column tree) # write (Out_channel stdout) `Enc_iso88591
48 prerr_endline(string_of_exn x);
55 (* ======================================================================
59 * Revision 1.1 2000/11/17 09:57:32 lpadovan
62 * Revision 1.2 2000/08/24 09:42:52 gerd
65 * Revision 1.1 2000/08/24 09:39:59 gerd