open Table
-
+let compteur = ref 0
let all_nodes tree = let root = Naive_tree.root tree in
eval_axis tree [root] (Descendant true)
end
in
debug tree q resultat;
+ compteur := !compteur + (List.length resultat);
resultat
+val compteur : int ref
+
val all_nodes : Naive_tree.t -> Naive_tree.node list
(** [all_nodes t] returns all the nodes in the tree [t].
Returns an empty list if there are no nodes in the tree.
print_node_list doc res;
print_string "</xml_result>\n"
) query_tree_list ;
-
+
+ let _ = if !Table_options.count then
+ Format.fprintf Format.std_formatter "there are %i nodes\n" !Query_tree.compteur;
+ in
+
(* let output =
match !Options.output_file with
| None | Some "-" | Some "/dev/stdout" -> stdout
open Arg
-
+let count = ref false
let input_file : string option ref = ref None
let output_file : string option ref = ref None
let queries = ref []
+
let set_string_option r s = r := Some s
let specs = align [
-
+ "-c", Set count,
+ " write the number of results only";
+ "--count", Set count, " ";
"-d", String (set_string_option input_file),
" specify the input document file [default stdin]";
"--doc", String (set_string_option input_file), " ";