Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/expelledboy/exml

Most simple Elixir wrapper for xmerl xpath
https://github.com/expelledboy/exml

elixir xml-parser xpath

Last synced: about 2 months ago
JSON representation

Most simple Elixir wrapper for xmerl xpath

Awesome Lists containing this project

README

        

Exml
====

[![Elixir CI](https://github.com/expelledboy/exml/actions/workflows/ci.yml/badge.svg)](https://github.com/expelledboy/exml/actions/workflows/ci.yml)
[![Hex.pm](https://img.shields.io/hexpm/v/exml.svg)](https://hex.pm/packages/exml)
[![Hex.pm](https://img.shields.io/hexpm/dt/exml.svg)](https://hex.pm/packages/exml)

Add to mix.exs

```elixir
defp deps() do
[
{:exml, "~> 0.1.3"}
]
end
```

Basic usage

```elixir
xml = """


Harry Potter
29.99


Learning XML
39.95


"""

doc = Exml.parse xml

Exml.get doc, "//book[1]/title/@lang"
#=> "en"

Exml.get doc, "//title"
#=> ["Harry Potter", "Learning XML"]
```

See [w3schools](https://www.w3schools.com/xml/xpath_syntax.asp) for details about xpath!