package ezxmlm

  1. Overview
  2. Docs
Combinators to use with XMLM for parsing and selection

Install

Dune Dependency

Authors

Maintainers

Sources

v1.0.1.tar.gz
sha256=b29e2bcd6196f5a288f973b1656c1de2ead741c2ff5279fc3bb74cbba66b21b2
md5=62beb40ede8d29a21adfff7c3bbe5de1

Description

An "easy" interface on top of the Xmlm [1] library. This version provides more convenient (but far less flexible) input and output functions that go to and from [string] values. This avoids the need to write signal code, which is useful for quick scripts that manipulate XML.

More advanced users should go straight to the Xmlm library and use it directly, rather than be saddled with the Ezxmlm interface. Since the types in this library are more specific than Xmlm, it should interoperate just fine with it if you decide to switch over.

Example

In the toplevel, here's an example of how some XHTML can be selected out quickly using the Ezxmlm combinators. Note that this particular HTML has been post-processed into valid XML using xmllint --html --xmlout.

# #require "ezxmlm" ;;
# open Ezxmlm ;;
# let (_,xml) = from_channel (open_in "html/variants.html") ;;
# member "html" x |> member "head" |> member_with_attr "meta" ;;
- : Xmlm.attribute list * nodes = ([(("", "name"), "generator"); (("", "content"), "DocBook XSL Stylesheets V1.78.1")], [])
# member "html" x |> member "head" |> member "title" |> data_to_string;;
- : string = "Chapter 6. Variants"                                                                                                                                                                                                                                                                                          

Ez peezy lemon squeezy!

[1] https://github.com/dbuenzli/xmlm

Tags

org:mirage org:ocamllabs

Published: 03 Jun 2014

Dependencies (4)

  1. ocamlbuild build
  2. xmlm >= "1.1.0"
  3. ocamlfind
  4. ocaml >= "4.01.0" & < "4.06.0"

Dev Dependencies

None

Used by (5)

  1. amqp-client >= "2.2.2"
  2. aws >= "1.0.0"
  3. jitsu
  4. podge >= "0.4"
  5. ppx_protocol_conv_xmlm

Conflicts

None

OCaml

Innovation. Community. Security.