]> matita.cs.unibo.it Git - helm.git/blob - helm/hbugs/tutors/ls_tutors.ml
fixed a typo (inside a comment)
[helm.git] / helm / hbugs / tutors / ls_tutors.ml
1 #!/usr/bin/ocamlrun /usr/bin/ocaml
2 (*
3  * Copyright (C) 2003:
4  *    Stefano Zacchiroli <zack@cs.unibo.it>
5  *    for the HELM Team http://helm.cs.unibo.it/
6  *
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.
10  *
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.
15  *
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.
20  *
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,
24  *  MA  02111-1307, USA.
25  *
26  *  For details, see the HELM World-Wide-Web page,
27  *  http://helm.cs.unibo.it/
28  *)
29 #use "topfind";;
30 #require "pxp";;
31 open Printf;;
32 open Pxp_document;;
33 open Pxp_dtd;;
34 open Pxp_types;;
35 open Pxp_yacc;;
36
37 let index = "INDEX.xml" ;;
38 let parse_xml fname =
39   parse_wfdocument_entity default_config (from_file fname) default_spec
40 ;;
41 let is_tutor node =
42   match node#node_type with T_element "tutor" -> true | _ -> false
43 ;;
44 let main () =
45   List.iter
46     (fun tutor ->
47       try
48         (match tutor#attribute "source" with
49         | Value s -> print_endline s
50         | _ -> assert false)
51       with Not_found -> assert false)
52     (List.filter is_tutor (parse_xml index)#root#sub_nodes)
53 ;;
54 main ();;
55