package xtmpl

  1. Overview
  2. Docs
module SMap : sig ... end
type pos = {
  1. line : int;
  2. bol : int;
  3. char : int;
  4. file : string option;
}
val pos : ?file:string -> line:int -> bol:int -> char:int -> unit -> pos
type loc = {
  1. loc_start : pos;
  2. loc_stop : pos;
}
val string_of_loc : loc -> string
val loc_sprintf : loc option -> ('a, unit, string) format -> 'a
type !'a with_loc = 'a * loc option
val loc : pos -> pos -> loc
type error = loc * string
exception Error of error
val error : loc -> string -> 'a
val string_of_error : (loc * string) -> string
type name = string * string
val string_of_name : (string * string) -> string
val name_of_string : string -> string * string
module Name_ord : sig ... end
module Name_map : sig ... end
module Name_set : sig ... end
module SSet : sig ... end
type cdata = {
  1. loc : loc option;
  2. text : string;
  3. quoted : bool;
}
type comment = {
  1. loc : loc option;
  2. comment : string;
}
type proc_inst = {
  1. loc : loc option;
  2. app : name;
  3. args : string;
}
type !'a attributes = 'a Name_map.t
type str_attributes = string with_loc attributes
type xml_decl = {
  1. loc : loc option;
  2. atts : str_attributes;
}
type doctype = {
  1. loc : loc option;
  2. name : name;
  3. args : string;
}
type node = {
  1. loc : loc option;
  2. name : name;
  3. atts : str_attributes;
  4. subs : tree list;
}
and tree =
  1. | E of node
  2. | D of cdata
  3. | C of comment
  4. | PI of proc_inst
type prolog_misc =
  1. | PC of comment
  2. | PPI of proc_inst
type prolog = {
  1. decl : xml_decl option;
  2. misc : prolog_misc list;
  3. doctype : doctype option;
}
type !'a doc = {
  1. prolog : prolog;
  2. elements : 'a list;
}
val node : ?loc:loc -> name -> ?atts:str_attributes -> tree list -> tree
val cdata : ?loc:loc -> ?quoted:bool -> string -> tree
val comment : ?loc:loc -> string -> tree
val prolog_comment : ?loc:loc -> string -> prolog_misc
val pi : ?loc:loc -> name -> string -> tree
val prolog_pi : ?loc:loc -> name -> string -> prolog_misc
val xml_decl : ?loc:loc -> str_attributes -> xml_decl
val doctype : ?loc:loc -> name -> string -> doctype
val prolog : ?decl:xml_decl -> ?doctype:doctype -> prolog_misc list -> prolog
val doc : prolog -> tree list -> tree doc
val merge_cdata : cdata -> cdata -> cdata
val doctype_name : 'a doc -> name option
type parse_param = {
  1. self_closing : SSet.t;
  2. entities : Uchar.t SMap.t;
}
val default_parse_param : parse_param
val xml_entities : Uchar.t SMap.t
val html_entities : Uchar.t SMap.t
val unescape : parse_param -> ?entities:bool -> string -> string
val escape : ?quotes:bool -> string -> string
val from_string : ?param:parse_param -> ?pos_start:pos -> string -> tree list
val from_channel : ?param:parse_param -> ?pos_start:pos -> in_channel -> tree list
val from_file : ?param:parse_param -> string -> tree list
val doc_from_string : ?param:parse_param -> ?pos_start:pos -> string -> tree doc
val doc_from_channel : ?param:parse_param -> ?pos_start:pos -> in_channel -> tree doc
val doc_from_file : ?param:parse_param -> string -> tree doc
val to_string : tree list -> string
val doc_to_string : tree doc -> string
val atts_empty : 'a attributes
val atts_of_list : ?atts:'a attributes -> (name * 'a) list -> 'a attributes
val atts_one : ?atts:'a attributes -> name -> 'a -> 'a attributes
val atts_remove : name -> 'a attributes -> 'a attributes
val atts_replace : name -> 'a -> 'a attributes -> 'a attributes
val get_att : 'a attributes -> name -> 'a option
val opt_att : str_attributes -> ?def:string -> name -> string * loc option
val string_of_atts : str_attributes -> string
OCaml

Innovation. Community. Security.