val iter : ( elt -> unit) -> t -> unit
val fold : ( elt -> 'a -> 'a) -> t -> 'a -> 'a
val length : t -> int
- val serialize : string -> Tree.t -> t -> unit
+ val serialize : string -> bool -> Tree.t -> t -> unit
end
let fold _ _ _ = failwith "fold not implemented"
let map _ _ = failwith "map not implemented"
let length x = x
- let serialize f _ x =
+ let serialize f b _ x =
let o = open_out f in
- output_string o "<xml_result>\n";
+ if not b then output_string o "<xml_result>\n";
output_string o (string_of_int x);
- output_string o "\n</xml_result>\n";
+ output_char o '\n';
+ if not b then output_string o "</xml_result>\n";
close_out o
end
let length l = l.length
- let serialize name v l =
+ let serialize name b v l =
let fd, finish =
if name = "-" then Unix.stdout, ignore
else
Unix.openfile name [ Unix.O_WRONLY; Unix.O_TRUNC; Unix.O_CREAT ] 0o666,
Unix.close
in
- ignore (Unix.write fd "<xml_result>\n" 0 13);
+ if not b then ignore (Unix.write fd "<xml_result>\n" 0 13);
if l.length > 0 then begin
iter (fun node -> Tree.print_xml v node fd) l;
Tree.flush v fd;
end;
- ignore (Unix.write fd "</xml_result>\n" 0 14);
+ if not b then ignore (Unix.write fd "</xml_result>\n" 0 14);
finish fd
end
val iter : ( elt -> unit) -> t -> unit
val fold : ( elt -> 'a -> 'a) -> t -> 'a -> 'a
val length : t -> int
- val serialize : string -> Tree.t -> t -> unit
+ val serialize : string -> bool -> Tree.t -> t -> unit
let twopass = ref false
let repeat = ref 1
let docstats = ref false
+let no_wrap_results = ref false
let set_index_type = function
| "default" -> text_index_type := 0
"-nc", Arg.Set(no_cache), " disable caching";
+ "-nw", Arg.Set(no_wrap_results), " do not wrap results in <xml_results/>";
"-p", Arg.Set(do_perf), " dump perf counters (Linux only)";