marcuslankenau
I feel kind of stuck with the absence of a proper xml library for Elixir. Currently I use SweetXML which was ok for me more or less to parse the xml content that I receive. But it doen’t feel natural to use.
Now I have to generate xml content as well. I have use cases like cutting nodes (with xpath) from one document, enriching that part with other data and generating a new document. I don’t feel like I can do that easily with SweetXML or floki (that I really like).
I put something together that almost covers what I need, have to continue on it. Maybe someone is interested in the project as well:
https://github.com/mlankenau/elixml
Marcus
Trending in Announcing
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
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
Introductory paragraph
I’ll be looking for a keen junior or someone that has a couple of years experience in the real world (so you’ve be...
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
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
OvermindDL1
For note, the BEAM has a built-in xml library called
xmerl(actually very powerful with multiple processing methods).However, being built-in it is very erlang’y, so elixir XML implementations and/or wrappers are nice.
BrightEyesDavid
Would using XSLT be an option? Xslt – Xslt v0.1.1
I don’t know where the data you need to add comes from, but if it too is XML maybe you could use XSLT’s document() function? (As it happens I was doing this the other day, but from bash, not Elixir.)
marcuslankenau
We have a couple of datasource (SOAP/XML, FTP/XML). We transform this data to json that we use internally. Normally we transform one XML to one JSON document. But there are exceptions where we need to combine different XMLs to reuse our existing mappings. I am not keen to use XML but i have to.
OvermindDL1
Oh I know that all too well. ^.^;
dimitarvp
This library can really use some more documentation.
Example: if I want to find certain elements via an XPath expression and then modify their contents and store the result as a new XML, how would I do that with Elixml?
marcuslankenau
I agree. The documentation is very basic and only showing some use cases with examples.
For your specific question:
You could parse the XML and manipulate the maps/array structure and store it as XML again. Not very convenient. Or we could think about having a map that works like the find and change nodes.
Why not open an issue with your feature request in the Github project and I will take care. Or you can contribute to the project if you like.
dimitarvp
Well, problem is, I have a work assignment and I am not looking at it through the eyes of an OSS contributor. I am looking for a ready-made solution.
I can file an issue alright, but offering a PR is highly unlikely at this point.
Cruz
Funny. I was about to embark on a little project that requires the parsing of a large XML file. Definitely great to see more efforts in this area!
While doing some research, I found Meeseeks:
https://github.com/mischov/meeseeks
@OvermindDL1 has recommended it in other post. Did you try it? If so, what was missing that you needed?
Thanks a lot
OvermindDL1
I use Meeseeks for both HTML and XML parsing, it’s awesome for both. The CSS and XPath selectors are supported on both HTML and XML parsing in it.
It does require having Rust’s compiler toolchain installed though.
dimitarvp
What about mutating the XML structure and writing it back to disk? Can it do that in combination with XPath?