X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Fxpath%2Fast.ml;h=9a0d4d72811b489c697be0aa7adb1357b4f4ef7b;hp=64c6c8da6214b7b863feaa28be40c883b5fd4aed;hb=fa7e819743a4a6d008ec086dfdeb2e30df2da701;hpb=53a0fd29a20e7f4550e0eb5fa5b0d5af6191c36d diff --git a/src/xpath/ast.ml b/src/xpath/ast.ml index 64c6c8d..9a0d4d7 100644 --- a/src/xpath/ast.ml +++ b/src/xpath/ast.ml @@ -13,12 +13,6 @@ (* *) (***********************************************************************) -(* - Time-stamp: -*) - -open Utils - type path = single_path list and single_path = Absolute of step list | Relative of step list and step = axis * test * expr list @@ -30,7 +24,7 @@ and axis = Self | Attribute | Child | PrecedingSibling | Preceding | Following -and test = QNameSet.t * Tree.Common.NodeKind.t +and test = QNameSet.t * Tree.NodeKind.t and binop = Eq | Neq | Lt | Gt | Lte | Gte | Or | And | Add | Sub | Mult | Div | Mod and unop = Neg @@ -128,20 +122,20 @@ and print_axis fmt a = pp fmt "%s" begin end and print_test fmt (ts,kind) = - let open Tree.Common.NodeKind in + let open Tree.NodeKind in match kind with Text -> pp fmt "%s" "text()" | Element | Attribute -> pp fmt "%s" begin if ts == star then "*" - else QName.to_string (QNameSet.choose ts) + else QName.to_string (QName.remove_prefix (QNameSet.choose ts)) end | Comment -> pp fmt "%s" "comment()" | ProcessingInstruction -> pp fmt "processing-instruction(%s)" begin if ts == star then "" - else "'" ^ (QName.to_string (QNameSet.choose ts)) ^ "'" + else "\"" ^ (QName.to_string (QName.remove_prefix (QNameSet.choose ts))) ^ "\"" end | Node -> pp fmt "%s" "node()" | Document -> pp fmt "%s" ""