package SZXX

  1. Overview
  2. Docs
type attr_list = (string * string) list
val sexp_of_attr_list : attr_list -> Sexplib0.Sexp.t
val get_attr : attr_list -> string -> string option

Convenience function to access attributes by name

val preserve_space : attr_list -> bool

Convenience function to check whether a node has attribute xml:space="preserve"

module DOM : sig ... end
module SAX : sig ... end
type parser_options = {
  1. accept_html_boolean_attributes : bool;
    (*

    Invalid XML but valid HTML: <div attr1="foo" attr2=bar> When this option is true, attr2 will be "bar"

    *)
  2. accept_unquoted_attributes : bool;
}
val default_parser_options : parser_options
val make_parser : parser_options -> SAX.node Angstrom.t
val parser : SAX.node Angstrom.t

IO-agnostic Angstrom.t parser.

It is not fully spec-compliant, it does not attempt to validate character encoding or reject all incorrect documents. It does not process references. It does not automatically unescape XML escape sequences automatically but unescape is provided to do so.

See README.md for examples on how to use it.

val unescape : string -> string

unescape "Fast &amp; Furious" returns "Fast & Furious"