package tyxml
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=c725bb8918ff1b601e7926b7b6b4799f8f4ab70f5fba9f0970da657cb82c07f2
sha512=61881aa7101b5072b887802e78897920516c9c2b484d51ac281509e83c79969c7654caa31b125ad843b45740dfe143ed5218fd7e4d98dfba8e0b24b272308ed6
doc/tyxml.functor/Xml_print/index.html
Module Xml_printSource
Printing utilities.
This module contains various encoding functions that can be used with Tyxml.Html.pp and Tyxml.Svg.pp.
It also contains functors to create printers for your own XML data structure.
Encoding functions
The encoder maps strings to HTML and must encode the unsafe characters '<', '>', '"', '&' and the control characters 0-8, 11-12, 14-31, 127 to HTML entities. encode_unsafe_char is the default for ?encode in output and pretty_print below. Other implementations are provided by the module Netencoding in the OcamlNet library, e.g.:
let encode = Netencoding.Html.encode ~in_enc:`Enc_iso88591 ~out_enc:`Enc_usascii ()Where national characters are replaced by HTML entities. The user is of course free to write her own implementation.
In addition, encode "@" as "@" in the hope that this will fool simple minded email address harvesters.
Utilities
encoding is the name of the character encoding, e.g. "US-ASCII" or "UTF-8"
Convert a float to a string using a compact representation compatible with the Javascript norm.
See string_of_number.
Formatter functors
module Make_typed_fmt
(Xml : Xml_sigs.Iterable)
(Typed_xml : Xml_sigs.Typed_xml with module Xml := Xml) :
Xml_sigs.Typed_pp
with type 'a elt := 'a Typed_xml.elt
and type doc := Typed_xml.docmodule Make_fmt
(Xml : Xml_sigs.Iterable)
(_ : TagList) :
Xml_sigs.Pp with type elt := Xml.eltPrinters for raw XML modules.
Deprecated functors
Use Make_fmt and Make_typed_fmt instead.
module Make
(Xml : Xml_sigs.Iterable)
(_ : TagList)
(O : Xml_sigs.Output) :
Xml_sigs.Printer with type out := O.out and type xml_elt := Xml.eltmodule Make_typed
(Xml : Xml_sigs.Iterable)
(Typed_xml : Xml_sigs.Typed_xml with module Xml := Xml)
(O : Xml_sigs.Output) :
Xml_sigs.Typed_printer
with type out := O.out
and type 'a elt := 'a Typed_xml.elt
and type doc := Typed_xml.docmodule Make_simple
(Xml : Xml_sigs.Iterable)
(_ : TagList) :
Xml_sigs.Simple_printer with type xml_elt := Xml.eltmodule Make_typed_simple
(Xml : Xml_sigs.Iterable)
(Typed_xml : Xml_sigs.Typed_xml with module Xml := Xml) :
Xml_sigs.Typed_simple_printer
with type 'a elt := 'a Typed_xml.elt
and type doc := Typed_xml.doc