Usable version:
[tatoo.git] / src / test.ml
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                     Kim Nguyen, LRI UMR8623                         *)
6 (*                   Université Paris-Sud & CNRS                       *)
7 (*                                                                     *)
8 (*  Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (*  Recherche Scientifique. All rights reserved.  This file is         *)
10 (*  distributed under the terms of the GNU Lesser General Public       *)
11 (*  License, with the special exception on linking described in file   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15
16
17 module F = Formula
18 (* to force ocaml build to add Formula to the dependency chain even if
19    we don't use it yet*)
20
21 let doc =
22   let fd = open_in Sys.argv.(1) in
23   let d = Tree.load_xml_file fd in
24   close_in fd; d
25
26
27
28 let query = XPath.parse Sys.argv.(2)
29
30 open Format
31
32 let () =
33   fprintf err_formatter "Query: %a\n%!" XPath.Ast.print query;
34   fprintf err_formatter "Document:\n%!";
35   Tree.print_xml stderr doc (Tree.root doc);
36   exit 0
37