Library
Module
Module type
Parameter
Class
Class type
Regular XML trees.
val parse_error : Types.loc -> string -> 'a
module Name : Map.OrderedType with type t = string * string
val string_of_name : Name.t -> string
val name_of_string : string -> Name.t
name_of_string str
cuts a name according to first ':' character. If no such character is found, return ("",str)
.
module P : sig ... end
XML documents with string*string
as names and optionnaly located string as attribute values.
include Types.S
with type name = Name.t
and type attr_value = P.attr_value
and type attributes = P.attr_value Name_map.t
and type data = unit
type name = Name.t
type attr_value = P.attr_value
type attributes = P.attr_value Name_map.t
val cdata_ : ?loc:Types.loc -> ?quoted:bool -> string -> Types.cdata
val comment_ : ?loc:Types.loc -> string -> Types.comment
val prolog_comment : ?loc:Types.loc -> string -> Types.comment
val xml_decl : ?loc:Types.loc -> attributes -> xml_decl
val prolog : ?decl:xml_decl -> ?doctype:doctype -> prolog_misc list -> prolog
val doc_empty : unit -> doc
val get_att : attributes -> name -> attr_value option
get_att atts name
returns the value associated to given attribute, if any.
val opt_att : attributes -> ?def:attr_value -> name -> attr_value
opt_att atts ?def name
returns the value associated to given attribute, or the default value specified by ?def
. If def
is not specified, P.default_attr_value
is used.
val atts_of_list : ?atts:attributes -> (name * attr_value) list -> attributes
atts_of_list list
returns a attributes
structure from the given list of pairs (name, value) ; (name, value) ; ...
.
val atts_one : ?atts:attributes -> name -> attr_value -> attributes
atts_one ?atts name value
is like atts_of_list
but for one attribute.
val atts_remove : name -> attributes -> attributes
atts_remove name attributes
removes the binding to name
from the attributes
.
val atts_replace : name -> attr_value -> attributes -> attributes
atts_replace name value attributes
adds a new bindings from name
to value
in attributes
. If name
was previously bound, the previous binding is removed.
val atts_fold :
(name -> attr_value -> 'acc -> 'acc) ->
attributes ->
'acc ->
'acc
val atts_empty : unit -> attributes
val pp_doc : Format.formatter -> doc -> unit
val pp : Format.formatter -> doc -> unit
val pp_attr : ?first:bool -> Format.formatter -> name -> attr_value -> unit
val pp_attributes : Format.formatter -> attributes -> unit
val pp_trees : Format.formatter -> tree list -> unit
val doc_to_string : doc -> string
val to_string : tree list -> string
val string_of_xml : tree -> string
val text_of_xmls : tree list -> string
val default_parse_param : parse_param
Default: no self-closing tags, unescape XML entities (amp, apos,quot, lt, gt). ignore_unclosed: false
.
mapping from XML entities to utf-8 code points
mapping from HTML entities to utf-8 code points
val unescape : parse_param -> ?entities:bool -> string -> string
Unescape character references and entity references from parse_param.entities
.
val from_string :
?param:parse_param ->
?pos_start:Types.pos ->
string ->
tree list
val from_channel :
?param:parse_param ->
?pos_start:Types.pos ->
in_channel ->
tree list
val from_file : ?param:parse_param -> string -> tree list
val doc_from_string :
?param:parse_param ->
?pos_start:Types.pos ->
string ->
doc
val doc_from_channel :
?param:parse_param ->
?pos_start:Types.pos ->
in_channel ->
doc
val doc_from_file : ?param:parse_param -> string -> doc