1 #!/usr/bin/ocamlrun /usr/bin/ocaml
3 * Copyright (C) 2003-2004:
4 * Stefano Zacchiroli <zack@cs.unibo.it>
5 * for the HELM Team http://helm.cs.unibo.it/
7 * This file is part of HELM, an Hypertextual, Electronic
8 * Library of Mathematics, developed at the Computer Science
9 * Department, University of Bologna, Italy.
11 * HELM is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * HELM is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with HELM; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
26 * For details, see the HELM World-Wide-Web page,
27 * http://helm.cs.unibo.it/
30 (* Usage: ls_tutors.ml # lists all tutors
31 * ls_tutors.ml -auto # lists only generated tutors
42 let index = "data/tutors_index.xml"
45 (match Sys.argv.(1) with "-auto" -> true | _ -> false)
46 with Invalid_argument _ -> false
48 parse_wfdocument_entity default_config (from_file fname) default_spec
50 match node#node_type with T_element "tutor" -> true | _ -> false
55 (match tutor#attribute "source" with
59 else (* we should print only generated tutors *)
61 ignore (find_element "no_auto" tutor);
65 with Not_found -> assert false)
66 (List.filter is_tutor (parse_xml index)#root#sub_nodes)