Warning: Reason support is experimental. We are looking for beta-tester and contributors.

Module Xml_print

module Xml_print : sig..end

Printer for XML.


val encode_unsafe_char : string -> string

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 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. See also OcamlNet

val encode_unsafe_char_and_at : string -> string

In addition, encode "@" as "&#64;" in the hope that this will fool simple minded email address harvesters.

val compose_decl : ?version:string -> ?encoding:string -> unit -> string

encoding is the name of the character encoding, e.g. "US-ASCII" or "UTF-8"

val compose_doctype : string -> string list -> string
module Make : functor (Xml : Xml_sigs.Iterable) -> 
  functor (I : sig      val emptytags : string listend) ->
  functor (O : Xml_sigs.Output) ->
  Xml_sigs.Printerwith type out := O.out and type xml_elt := Xml.elt
module Make_typed : functor (Xml : Xml_sigs.Iterable) -> 
  functor (Typed_xml : Xml_sigs.Typed_xml     with module Xml := Xml) ->
  functor (O : Xml_sigs.Output) ->
  
  Xml_sigs.Typed_printerwith type out := O.out
and type 'a elt := 'a Typed_xml.elt
and type doc := Typed_xml.doc
module Make_simple : functor (Xml : Xml_sigs.Iterable) -> 
  functor (F : sig      val emptytags : string listend) ->
  Xml_sigs.Simple_printerwith type xml_elt := Xml.elt
module Make_typed_simple : functor (Xml : Xml_sigs.Iterable) -> 
  functor (Typed_xml : Xml_sigs.Typed_xml     with module Xml := Xml) ->
  
  Xml_sigs.Typed_simple_printerwith type 'a elt := 'a Typed_xml.elt
and type doc := Typed_xml.doc