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

(* $Id: sax.mli,v 1.4 2002/09/04 23:22:32 simeon Exp $ *)

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

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

(* Type for sax events *)

type sax_xml_attribute =
    Sym.attr_symbol * Simple._text

and sax_xml_attribute_forest =
    sax_xml_attribute list

type sax_xml_decl =
    (Simple._text * Conf.encoding_kind option * Simple._text option) option

type element_desc =  Sym.elem_symbol * sax_xml_attribute_forest
type pi_desc = Simple._ncName * Simple._text
type comment_desc = Simple._text
type text_desc = Simple._text

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

