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

(* $Id: project_context.mli,v 1.1 2003/05/21 15:03:49 simeon Exp $ *)

(* Module: Project_context
   Description:
     This module implements the context used during projection.
*)


(* Type used for the projection context *)

type project_context


(* Builds a new projection context *)

val build_project_context :
    Sax_types.xml_stream ->
      Path_struct.path_fragment_sequence ->
	Sax_types.sax_event list -> project_context


(* Accessors to the projection context *)

val get_pfs            : project_context -> Path_struct.path_fragment_sequence option
val get_local_buffer   : project_context -> Sax_types.sax_event list
val get_nsenv          : project_context -> Namespace.nsenv
val get_next_xml_event : project_context -> Sax_types.sax_event
val get_stream         : project_context -> Sax_types.xml_stream

val get_next_buffered_sax_event  : project_context -> Sax_types.sax_event option
val peek_next_buffered_sax_event : project_context -> Sax_types.sax_event option


(* Change the local_buffer *)

val refill_local_buffer  : project_context -> Sax_types.sax_event list -> unit

val push_project_context_get_subtree :
    project_context -> Sax_types.sax_event -> unit

val push_project_context_keep_moving_skip_node :
    project_context -> Namespace.nsenv -> Sax_types.sax_event -> Path_struct.path_fragment_sequence -> unit

val push_project_context_keep_moving_preserve_node :
    project_context -> Namespace.nsenv -> Sax_types.sax_event -> Path_struct.path_fragment_sequence -> unit

val push_project_context_preserve_node :
    project_context -> Sax_types.sax_event list -> unit

val push_project_context_skip_node :
    project_context -> unit

val push_project_context :
    project_context -> Namespace.nsenv -> unit

val pop_project_context  : project_context -> Sax_types.sax_event list -> unit


