X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Ftable.ml;h=ae446eaf12578fe108e7bd67939400f3e681ebca;hp=8e4f2e6d2137c1a1ff56e588feffa911a830da0b;hb=273665d1294e6253fbd45137471e7dd568b38735;hpb=72880536f01e8260441efda43430f893e8e4595b diff --git a/src/table.ml b/src/table.ml index 8e4f2e6..ae446ea 100644 --- a/src/table.ml +++ b/src/table.ml @@ -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