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

(* $Id: serialization_context.mli,v 1.2 2003/06/21 15:30:55 simeon Exp $ *)

(* Module: Serialization_context
   Description:
     This module implements a the serialization context.
*)


(* Kinds of elements *)

type serial_element_kind =
  | ElementContentInTextElement
  | ElementContentInContentElement
  | TextElementInElementContent
  | TextElementInTextContent
  | TopElement

(* A type for the serialization context *)

type serialization_context

(* Creates a new loading context *)

val build_serialization_context :
    Conf.serialization_kind ->
      Glx_pxp.rep_encoding ->
	Glx_pxp.encoding ->
	  Whitespace.mode ->
	    Sax_types.xml_stream ->
	      serialization_context

val get_serialization_kind : serialization_context -> Conf.serialization_kind

val get_internal_encoding : serialization_context -> Glx_pxp.rep_encoding

val get_target_encoding : serialization_context -> Glx_pxp.encoding

val get_next_event : serialization_context -> Sax_types.sax_event

val peek_next_event : serialization_context -> Sax_types.sax_event option

val get_current_element_kind : serialization_context -> serial_element_kind

val new_current_element_kind : serial_element_kind -> Sax_types.has_element_content -> serial_element_kind

val push_element : serialization_context -> (Namespace.uqname * serial_element_kind) -> unit

val pop_element : serialization_context -> (Namespace.uqname * serial_element_kind)

val push_document : serialization_context -> unit

val pop_document : serialization_context -> unit

val is_toplevel : serialization_context -> bool

val is_empty : serialization_context -> bool

