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

(* $Id: sax.mli,v 1.7 2002/11/21 18:39:42 simeon Exp $ *)

(* This is a test of a SAX-like parser for Galax *)

(*************)
(* SAX types *)
(*************)

(* Type for sax events *)

type sax_xml_attribute =
    Namespace.uqname * Datatypes._untyped

and sax_xml_attribute_forest =
    sax_xml_attribute list

type sax_xml_decl =
    (Datatypes._untyped * Conf.encoding_kind option * Datatypes._untyped option) option

type element_desc =  Namespace.uqname * sax_xml_attribute_forest
type pi_desc = Namespace.ncname * Datatypes._untyped
type comment_desc = Datatypes._untyped
type text_desc = Datatypes._untyped

type sax_event =
  | SAX_startDocument of sax_xml_decl
  | SAX_endDocument
  | SAX_startElement of element_desc
  | SAX_endElement
  | SAX_processingInstruction of pi_desc
  | SAX_comment of comment_desc
  | SAX_characters of text_desc

type doc_stream

(***************************)
(* Top level SAX functions *)
(***************************)

val open_event_stream 		     : string -> doc_stream
	       
val next_xml_event    		     : doc_stream -> sax_event

(*
val next_xml_event_remove_whitespace : doc_stream -> sax_event
*)


(****************************)
(* Operations on SAX Events *)
(****************************)

val get_start_document          : doc_stream -> sax_xml_decl
val get_end_document            : doc_stream -> unit

