Library
Module
Module type
Parameter
Class
Class type
Base types and functor to create XML documents.
type pos = Lexing.position
A position in a source (file, string, ...).
val pos :
?fname:string ->
line:int ->
bol:int ->
char:int ->
unit ->
Lexing.position
type 'a with_loc = 'a * loc
type 'a with_loc_option = 'a * loc option
loc loc_start loc_stop
creates a loc
structure with the given positions.
val loc_of_pos : Lexing.position -> int -> Lexing.position * Lexing.position
loc_of_pos p len
creates a loc
structure with starting at position p
and ending at position p + len
. We aware that only the pos_cnum
field is modified in the ending position.
val string_of_loc : (Lexing.position * Lexing.position) -> string
val string_of_loc_option : (Lexing.position * Lexing.position) option -> string
val pp_loc : Format.formatter -> (Lexing.position * Lexing.position) -> unit
val pp_loc_option :
Format.formatter ->
(Lexing.position * Lexing.position) option ->
unit
val loc_sprintf :
(Lexing.position * Lexing.position) option ->
('a, unit, string) format ->
'a
exception Error of error
val error : error -> 'a
val register_string_of_error : (error -> string option) -> unit
val string_of_error : error -> string
module type P = sig ... end
module type S = sig ... end
module Make
(P : P) :
S
with type name = P.Attributes.key
and type attr_value = P.attr_value
and type attributes = P.attr_value P.Attributes.t
and type data = P.data
merge_cdata c1 c2
returns a new cdata
by merging text of the ones provided. If both have a location, the returned cdata
has a location, ranging from the start position of the first to the end position of the second. If any of the cdatas has its quoted
flag set to true
, then the new cdata has this flag set to true
.
type ('n1, 'av1, 'a1, 'd1, 'n2, 'av2, 'a2, 'd2) map_param = {
map_name : 'n1 -> 'n2;
mapping names
*)map_attr_value : 'av1 -> 'av2;
mapping attribute values
*)map_attributes : ('a1 -> 'a2) option;
mapping attributes; if provided attributes will be mapped by this function; else map_name
and map_attr_value
will be used for mapping each pair (name, value) of attributes.
map_data : 'd1 -> 'd2;
mapping data
*)}
Description of how to map various types in trees
type ('a1, 'x1, 'd1, 'p1, 'a2, 'x2, 'd2, 'p2) mapper = {
map_atts : 'a1 -> 'a2;
map attributes
*)map_xml : 'x1 -> 'x2;
map a single tree
*)map_xmls : 'x1 list -> 'x2 list;
map a list of trees
*)map_doc : 'd1 -> 'd2;
map a whole document
*)map_prolog : 'p1 -> 'p2;
map prolog of a document
*)}
The functions to map trees and documents, obtained with Make_map.mapper
.