-let rec test_text dir t acc ctx =
- if Tree.Binary.is_node t
- then
- let acc =
- if (Tree.Binary.tag t) == (Tag.pcdata)
- then Ata.TS.cons t acc
- else acc
- in
- let first = Tree.Binary.text_below t
- and next = Tree.Binary.text_next t ctx
- in
- (*
- let _ =
- Printf.printf "t is :";
- Tree.Binary.print_xml_fast stdout t;
- Printf.printf " called from %s of " (if dir then "below" else "next");
- Tree.Binary.print_xml_fast stdout ctx;
- if (Tree.Binary.is_node first)
- then begin
- Printf.printf "First (text) is %!";
- Tree.Binary.print_xml_fast stdout first;
- end
- else
- Printf.printf "First (text) is empty!";
- if (Tree.Binary.is_node next)
- then begin
- Printf.printf ", Next (text) is %!";
- Tree.Binary.print_xml_fast stdout next;
- end
- else
- Printf.printf ", Next (text) is empty!";
- print_newline();
- in *)
- test_text false next (test_text true first acc t) ctx
- else acc
+let full_traversal tree =
+ let rec loop t =
+ if Tree.is_node t
+ then
+ begin
+ (*ignore (Tree.tag t); *)
+ loop (Tree.node_child t);
+ loop (Tree.node_sibling t);
+ end
+ in loop tree