Tyxml_xml
Basic functions for construction and manipulation of XML tree.
include Xml_sigs.Iterable with type uri = string and type event_handler = string and type mouse_event_handler = string and type
keyboard_event_handler = string and type touch_event_handler = string
include Xml_sigs.NoWrap with type uri = string with type event_handler = string with type
mouse_event_handler = string with type keyboard_event_handler = string with type touch_event_handler = string
module W = Xml_wrap.NoWrap
type 'a wrap = 'a W.t
type 'a list_wrap = 'a W.tlist
val event_handler_attrib : aname -> event_handler -> attrib
val mouse_event_handler_attrib : aname -> mouse_event_handler -> attrib
val keyboard_event_handler_attrib : aname -> keyboard_event_handler -> attrib
val touch_event_handler_attrib : aname -> touch_event_handler -> attrib
val empty : unit -> elt
val comment : string -> elt
val entity : string -> elt
val cdata : string -> elt
val cdata_script : string -> elt
val cdata_style : string -> elt
type acontent = private
| AFloat of float |
| AInt of int |
| AStr of string |
| AStrL of separator * string list |
include Xml_sigs.Pp with type elt := elt
val pp : ?encode:(string -> string) -> ?indent:bool -> unit -> Format.formatter -> elt -> unit
pp ()
is a Format
printer for untyped XML.
It can be used in combination with "%a"
. For example, to get a string:
let s = Format.asprintf "%a" (pp ()) my_xml
A custom encoding function can be provided with the ~encode
argument. Various implementations of encode
are available in Xml_print
.
val of_seq : Xml_stream.signal Seq.t -> elt list
Recursively edit attributes for the element and all its children.
Edit attributes only for one element.
The following can safely be exported by higher level libraries, because removing an attribute from a element is always legal.
Exporting the following by higher level libraries would drive a hole through a type system, because they allow to add any attribute to any element.
val all_entities : elt -> string list
val print_list : output:(string -> unit) -> ?encode:(string -> string) -> elt list -> unit
val print : Format.formatter -> elt -> unit