package xtmpl

  1. Overview
  2. Docs
module Xml = Xtmpl_xml
type name = string * string
type attributes = tree list Xml.attributes
and node = {
  1. loc : Xml.loc option;
  2. name : name;
  3. atts : attributes;
  4. subs : tree list;
}
and tree =
  1. | E of node
  2. | D of Xml.cdata
  3. | C of Xml.comment
  4. | PI of Xml.proc_inst
val node : ?loc:Xml.loc -> name -> ?atts:attributes -> tree list -> tree
val cdata : ?loc:Xml.loc -> ?quoted:bool -> string -> tree
val comment : ?loc:Xml.loc -> string -> tree
val pi : ?loc:Xml.loc -> name -> string -> tree
val doc : Xml.prolog -> tree list -> tree Xml.doc
val upto_first_element : tree list -> tree list
val atts_empty : attributes
val atts_of_list : ?atts:attributes -> (name * tree list) list -> attributes
val atts_one : ?atts:attributes -> name -> tree list -> attributes
val atts_remove : name -> attributes -> attributes
val atts_replace : name -> tree list -> attributes -> attributes
val get_att : attributes -> name -> tree list option
val get_att_cdata : attributes -> name -> string option
val opt_att : attributes -> ?def:tree list -> name -> tree list
val opt_att_cdata : attributes -> ?def:string -> name -> string
type 'a env = 'a callback Xml.Name_map.t
and !'a callback = 'a -> 'a env -> ?loc:Xml.loc -> attributes -> tree list -> 'a * tree list
exception No_change
val env_empty : unit -> 'a env
val env_add_cb : ?prefix:string -> string -> 'a callback -> 'a env -> 'a env
val env_add_xml : ?prefix:string -> string -> tree list -> 'a env -> 'a env
val env_get : name -> 'a env -> 'a callback option
val string_of_env : 'a env -> string
val env_of_list : ?env:'a env -> (name * 'a callback) list -> 'a env
type rewrite_stack = (name * attributes * tree list * Xml.loc option) list
type error =
  1. | Loop of rewrite_stack
  2. | Parse_error of Xml.loc * string
  3. | Parse_attribute_error of Xml.loc option * name * string
  4. | Invalid_attribute_value of string * tree list
  5. | Fixpoint_limit of int
exception Error of error
val loop_error : rewrite_stack -> 'a
val parse_error : Xml.loc -> string -> 'a
val invalid_attribute_value : string -> tree list -> 'a
val fixpoint_limit : int -> 'a
val string_of_error : error -> string
val string_of_rewrite_stack : rewrite_stack -> string
val tag_env : string
val att_defer : string
val att_escamp : string
val att_protect : string
val from_xml : Xml.tree -> tree
val from_xmls : Xml.tree list -> tree list
val from_xml_atts : Xml.str_attributes -> attributes
val from_doc : Xml.tree Xml.doc -> tree Xml.doc
val to_xml : ?xml_atts:bool -> tree -> Xml.tree
val to_xmls : ?xml_atts:bool -> tree list -> Xml.tree list
val to_doc : ?xml_atts:bool -> tree Xml.doc -> Xml.tree Xml.doc
val to_string : ?xml_atts:bool -> tree list -> string
val atts_to_string : ?xml_atts:bool -> attributes -> Xml.str_attributes
val doc_to_string : ?xml_atts:bool -> tree Xml.doc -> string
val from_string : ?pos_start:Xml.pos -> string -> tree list
val doc_from_string : ?pos_start:Xml.pos -> string -> tree Xml.doc
val from_file : string -> tree list
val doc_from_file : string -> tree Xml.doc
val merge_cdata : tree -> tree
val merge_cdata_list : tree list -> tree list
val apply_to_string : 'a -> 'a env -> string -> 'a * tree list
val apply_to_file : 'a -> 'a env -> string -> 'a * tree list
val apply_to_xmls : 'a -> 'a env -> tree list -> 'a * tree list
val apply_to_doc : 'a -> 'a env -> tree Xml.doc -> 'a * tree Xml.doc
val apply_into_file : 'a -> ?head:string -> 'a env -> infile:string -> outfile:string -> 'a
val apply_string_into_file : 'a -> ?head:string -> 'a env -> outfile:string -> string -> 'a
OCaml

Innovation. Community. Security.