Giter Club home page Giter Club logo

ezxmlm's Introduction

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

ezxmlm's People

Contributors

avsm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.