package tyxml

  1. Overview
  2. Docs
TyXML is a library for building correct HTML and SVG documents

Install

Dune Dependency

Authors

Maintainers

Sources

tyxml-4.4.0.tbz
sha256=516394dd4a5c31726997c51d66aa31cacb91e3c46d4e16c7699130e204042530
sha512=d5f2187f8410524cec7a14b28e8950837070eb0b6571b015dd06076c2841eb7ccaffa86d5d2307eaf1950ee62f9fb926477dac01c870d9c1a2f525853cb44d0c

doc/tyxml.functor/Xml_print/Utf8/index.html

Module Xml_print.Utf8Source

Utf8 normalizer and encoder for HTML.

Given a pp function produced by one of the functors in Xml_print, this modules is used as following:

  let encode x = fst (Xml_print.Utf8.normalize_html x) in
  Format.printf "%a" (Html.pp ~encode ()) document
Sourcetype utf8 = string
Sourceval normalize : string -> utf8 * bool

normalize str take a possibly invalid utf-8 string and return a valid utf-8 string where invalid bytes have been replaced by the replacement character U+FFFD. The returned boolean is true if invalid bytes were found

Sourceval normalize_html : string -> utf8 * bool

Same as normalize plus some extra work : It encode '<' , '>' , '"' , '&' characters with corresponding entities and replaced invalid html character by U+FFFD

OCaml

Innovation. Community. Security.