6 Xpath.Parser.parse (Ulexing.from_utf8_string p)
9 let () = Table_options.parse () in
11 let fd, close_fd = match !Table_options.input_file with
12 None | Some "-" | Some "/dev/stdin" ->stdin,ignore
14 let fd = open_in input in fd, fun() -> close_in fd
16 (*let inc = open_in Sys.argv.(1) in*)
17 let doc = Naive_tree.load_xml_file fd in
21 (*Hashtbl.clear Query_tree.table_query_tree; il faut vider le hashtbl?????????????????*)
25 !Table_options.queries
28 List.map (fun query -> compile_xpath query) queries
31 let res = eval_query_tree doc [ (Naive_tree.root doc) ] q in
32 print_string "<xml_result num=\"1\" >\n";
33 print_node_list doc res;
34 print_string "</xml_result>\n"
37 let _ = if !Table_options.count then
38 Format.fprintf Format.std_formatter "there are %i nodes\n" !Query_tree.compteur;