tyxml

TyXML is a library for building statically correct HTML5 and SVG documents
Library tyxml_f

Parameters

module Typed_xml : Xml_sigs.Typed_xml with module Xml := Xml

Signature

val pp_elt : ?encode:( string -> string ) -> unit -> Format.formatter -> 'a Typed_xml.elt -> unit

pp_elt () is a Format printer for individual elements.

A custom encoding function can be provided with the ~encode argument. Various implementations of encode are available in Xml_print.

val pp : ?encode:( string -> string ) -> ?advert:string -> unit -> Format.formatter -> Typed_xml.doc -> unit

pp () is a Format printer for complete documents.

It can be used in combination with "%a". For example, to get a string:

let s = Format.asprintf "%a" (pp ()) my_document

A custom encoding function can be provided with the ~encode argument. Various implementations of encode are available in Xml_print.