(***********************************************************************)
(*                                                                     *)
(*                                 GALAX                               *)
(*                            XML Query Engine                         *)
(*                                                                     *)
(*  Copyright 2000, Lucent Technologies.                               *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)

(* $Id: path_struct.mli,v 1.7 2002/11/06 15:53:29 simeon Exp $ *)

(* This is our famous path structure
    - Jerome and Amelie *)

open Namespace
open Xquery_ast

(* Types for paths structures *) 

type path = (axis * cnode_test) list

type docid = string

type subtree =
  | Subtree
  | NoSubtree

type rooted_path = docid * path * subtree

type path_sequence = rooted_path list

val imposes_subtree : path_sequence -> path_sequence

(* New from here - Jerome *)

type path_fragment_sequence = (path * subtree) list

type action =
  | GetSubtree
  | PreserveNode
  | SkipNode
  | KeepMovingPreserveNode of path_fragment_sequence
  | KeepMovingSkipNode of path_fragment_sequence

val inside_document : Namespace.nsenv -> Sax.sax_event -> path_sequence -> docid -> path_fragment_sequence

val one_step : Namespace.nsenv -> Sax.sax_event -> path_fragment_sequence -> action

(* attributes *)

val one_step_attribute : Namespace.nsenv -> path_fragment_sequence -> Sax.sax_xml_attribute -> bool

(* Printing of path structures *)

val print_path_sequence : Format.formatter -> path_sequence -> unit

