+let _ = Printf.printf "Testing //a with jumping\n"
+;;
+*)
+let rec test_a dir t acc ctx =
+ if Tree.Binary.is_node t
+ then
+ let acc =
+ if (Tree.Binary.tag t) == (Tag.tag "a")
+ then Ata.TS.cons t acc
+ else acc
+ in
+ let first = Tree.Binary.tagged_below t Ptset.empty (Ptset.singleton (Tag.tag "a"))
+ and next = Tree.Binary.tagged_next t Ptset.empty (Ptset.singleton (Tag.tag "a")) 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 next)
+ then begin
+ Printf.printf ", Next a is %!";
+ Tree.Binary.print_xml_fast stdout next;
+ end
+ else
+ Printf.printf ", Next a is empty!";
+ print_newline();
+ in
+ test_a false next (test_a true first acc t) t
+ else acc
+;;
+
+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