markup

Error-recovering functional HTML5 and XML parsers and writers
Legend:
Library
Module
Module type
Parameter
Class
Class type
Library markup
Module type Markup . ASYNCHRONOUS

Threads

type 'a io

Thread type. Replaced by 'a Lwt.t in Markup_lwt.

Encodings

module Encoding : sig ... end

Asynchronous counterpart to Markup.Encoding.

XML

val parse_xml : ?report:( location -> Error.t -> unit io ) -> ?encoding:Encoding.t -> ?namespace:( string -> string option ) -> ?entity:( string -> string option ) -> ?context:[< `Document | `Fragment ] -> ( char, _ ) stream -> async parser
val write_xml : ?report:( (signal * int) -> Error.t -> unit io ) -> ?prefix:( string -> string option ) -> ( [< signal ], _ ) stream -> ( char, async ) stream

HTML

val parse_html : ?report:( location -> Error.t -> unit io ) -> ?encoding:Encoding.t -> ?context:[< `Document | `Fragment of string ] -> ( char, _ ) stream -> async parser
val write_html : ( [< signal ], _ ) stream -> ( char, async ) stream

I/O

val fn : ( unit -> char option io ) -> ( char, async ) stream
val to_string : ( char, _ ) stream -> string io
val to_buffer : ( char, _ ) stream -> Buffer.t io

Stream manipulation

val stream : ( unit -> 'a option io ) -> ( 'a, async ) stream
val next : ( 'a, _ ) stream -> 'a option io
val peek : ( 'a, _ ) stream -> 'a option io
val transform : ( 'a -> 'b -> ('c list * 'a option) io ) -> 'a -> ( 'b, _ ) stream -> ( 'c, async ) stream
val fold : ( 'a -> 'b -> 'a io ) -> 'a -> ( 'b, _ ) stream -> 'a io
val map : ( 'a -> 'b io ) -> ( 'a, _ ) stream -> ( 'b, async ) stream
val filter : ( 'a -> bool io ) -> ( 'a, _ ) stream -> ( 'a, async ) stream
val filter_map : ( 'a -> 'b option io ) -> ( 'a, _ ) stream -> ( 'b, async ) stream
val iter : ( 'a -> unit io ) -> ( 'a, _ ) stream -> unit io
val drain : ( 'a, _ ) stream -> unit io
val to_list : ( 'a, _ ) stream -> 'a list io
val load : ( 'a, _ ) stream -> ( 'a, sync ) stream io

load s converts a general stream s to a synchronous stream by buffering it.

Utility

val tree : ?text:( string list -> 'a ) -> ?element:( name -> (name * string) list -> 'a list -> 'a ) -> ?comment:( string -> 'a ) -> ?pi:( string -> string -> 'a ) -> ?xml:( xml_declaration -> 'a ) -> ?doctype:( doctype -> 'a ) -> ( [< signal ], _ ) stream -> 'a option io