OCaml HTML5 parser/serialiser based on Python's JustHTML
1(** Base checker module for HTML5 conformance checking. *)
2
3module type S = sig
4 type state
5
6 val create : unit -> state
7 val reset : state -> unit
8
9 val start_element :
10 state ->
11 name:string ->
12 namespace:string option ->
13 attrs:(string * string) list ->
14 Message_collector.t ->
15 unit
16
17 val end_element :
18 state -> name:string -> namespace:string option -> Message_collector.t -> unit
19
20 val characters : state -> string -> Message_collector.t -> unit
21 val end_document : state -> Message_collector.t -> unit
22end
23
24type t = (module S)
25
26(** No-operation checker implementation. *)
27module Noop = struct
28 type state = unit
29
30 let create () = ()
31 let reset () = ()
32
33 let start_element () ~name:_ ~namespace:_ ~attrs:_ _ = ()
34 let end_element () ~name:_ ~namespace:_ _ = ()
35 let characters () _ _ = ()
36 let end_document () _ = ()
37end
38
39let noop () = (module Noop : S)