remedier a la liste desordonné par l'ajout de sort a la fin de la fonction eval_query...
[tatoo.git] / src / table.ml
index 8e4f2e6..ae446ea 100644 (file)
@@ -9,8 +9,19 @@ type query_tree = Binop of op * query_tree * query_tree
                  | Axis of Xpath.Ast.axis * query_tree
                  | Start 
                  | Dom
-                 | Tag of QNameSet.t
+                 | Tag of QNameSet.t * Tree.NodeKind.t
 and op = Union | Inter | Diff
+(*and query_tree = {
+  mutable desc  : query_tree_desc;
+  mutable id : int;
+  mutable hash : int;
+}
+*)
+
+
+
+
+
 
 (*28/01/2014  
   parametres : tree  l'arbre xml
@@ -29,7 +40,7 @@ let rec print_query_tree fmt q =
   match q with
       Dom -> Format.fprintf fmt "Dom"
     | Start -> Format.fprintf fmt "Start"
-    | Tag t -> Format.fprintf fmt "Tag(%a)" QNameSet.print t
+    | Tag (t,k) -> Format.fprintf fmt "Tag(%a, %a)" QNameSet.print t Tree.NodeKind.print k
     | Axis (a,q) ->
       Format.fprintf fmt "%a(%a)" Xpath.Ast.print_axis a print_query_tree q
     | Binop (op,q1,q2) -> 
@@ -102,18 +113,19 @@ and eval_star tree ls lr =
   retour : l'ensemble de noeuds qui correspondent à¥† l'axe
 *)
 
-let keep_elements t l =
+let keep_elements t l = (*
    List.filter (fun n -> match Naive_tree.kind t n with
      | Element | Text | Document | Attribute -> true | _ -> false) l
+                       *) l
 
-let keep_attributs t l =
+let keep_attributs t l = (*
   List.filter (fun n -> match Naive_tree.kind t n with
-    | Attribute ->true | _ -> false) l
+    | Attribute ->true | _ -> false) *) l
 
 let rec eval_axis tree ls a =
   let open Xpath.Ast in
        match a with
-           Self -> keep_elements tree ls
+           Self -> ls
              
          | Attribute -> let lfc = eval_move tree ls Firstchild in
                         let lc = eval_star tree lfc [Nextsibling] in