Overbryd
A module to decode/encode xml into a tree structure.
- GitHub - Overbryd/exoml: A module to decode/encode xml into a tree structure · GitHub
- Exoml – exoml v0.0.2
The aim of this parser is to be able to represent any xml document as a tree-like structure, but be able to put it back together in a sane way.
In comparison to other xml parsers, this one preserves broken stuff. The goal is to be able to decode the typical broken html document, modify it, and encode it again, without loosing too much of its original content.
Currently the parser preserves whitespace between <xml> nodes, so <pre> or <textarea> tags should be unaffected, by a decode/1 into encode/1.
The only part where the parser tidies up, is the attr=“part” of a <xml attr=”part”> node.
With well-formed XML, the parser does work really well.
Trending in Announcing
Earmark is a pure-Elixir Markdown converter.
It is intended to be used as a library (just call Earmark.as_html), but can also be used as...
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hi everyone :waving_hand:
I’ve been working on PhiaUI, an open-source UI component library for Phoenix LiveView, and I wanted to share i...
New
Hello Elixir community!
I am excited to announce the release of a new Elixir library for interacting with the Ethereum blockchain: Ether...
New
Continuum is an OTP-native durable execution engine for Elixir, backed by Postgres. IIt’s an Elixir-native answer to Temporal in other ec...
New
Other Trending Topics
On November 23, 2026, an unauthorized third party exploited a vulnerability in hex.pm (CVE-2026-129514, CVSS 10.0) that let them run comm...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Popcorn, the library that runs Elixir code in the browser, is now stable :popcorn:
This is possible because it now builds on a very stab...
New
If you haven’t tried Hologram yet, what’s stopped you?
Here’s why I’m asking. Building a framework turns out to be two jobs, the framewo...
New
Well some of us wanted a difficulty spike - and today we got one :sweat_smile:
https://github.com/sevenseacat/advent_of_code/blob/main/l...
New
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #code-sync
- #exunit
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #ai
- #authentication
- #elixirconf-us
- #umbrella
- #full-time-contract
- #blog-post
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-eu
- #distillery
- #security
- #processes
- #api
- #forms
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
marcuslankenau
Wow, I saw this too late. Started something similar a couple of days ago (GitHub - mlankenau/elixml: Easy to use xml manipulation in Elixir · GitHub). But I am not aiming for html parsing. It is pure XML with XMLNS but other than that there are a lot of things in common. What I needed was the ability to construct and save xml (that you are supporting as well) and searching with an xpath-subset.
I was missing these feature complete xml libs that we have in the ruby world. Thats the long term goal.
OvermindDL1
I’m still curious what the built-in-to-the-BEAM XML libraries are lacking though (a better interface perhaps)?
marcuslankenau
Honestly I don’t have any strong points for crafting my own stuff. I think it is probably ok to go with the errang lib as well. My experience with SweetXML was a little bit painful but that might not be the fault of the erlang lib.
My only points
Overbryd
Cool, I’ll have a look. Maybe we can join efforts for a great Elixir-native XML-library. (see my dismissal of parsing HTML in my reply below)
Overbryd
Update on parsing HTML. I initially thought of using exoml to parse HTML as well, I dismissed that idea.
Practically HTML cannot just be tokenized into a tree like XML.
HTML is its own very weird language, and cannot be treated as XML at all. They look very much the same, but are insanely different in their inner workings.
So using exoml to build a tree out of a HTML document will lead to problems.
I refer to the introduction of Alexander Borisov, the author of myhtml, explaining the tokenization/parsing issue in greater detail: http://lexborisov.github.io/benchmark-html-persers/
He gives a great concise example:
That is also why I started working on Bindings for myhtml.
See this thread: Myhtmlex - bindings to lexborisov's fast html parser myhtml
OvermindDL1
HTML is based on SGML, not XML.
Yes, SGML is horrible.
CharlesO
They might be lacking performance, for parsing big xml files.
i’m struggling to parse / load an 80mb xml file.
OvermindDL1
Isn’t that the purpose of the sax/event built-in erlang xml parsers though?
CharlesO
I found that just reading the
.xmlfile directly withFile.read!and splitting on\r\n, then parsing out data row by row is far far faster and more flexible that using any xml parsing library.OvermindDL1
I would certainly hope it would be. ^.^
It’s not doing parsing, validation, nothing of the sort, so you just kind of have to hope the file is proper for the structure you expect without changing, but at that point it’s not treated as XML anyway.