marcuslankenau

marcuslankenau

Elixml - XML library

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:

Marcus

Most Liked

OvermindDL1

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.

OvermindDL1

OvermindDL1

For note, the BEAM has a built-in xml library called xmerl (actually very powerful with multiple processing methods). :slight_smile:

However, being built-in it is very erlang’y, so elixir XML implementations and/or wrappers are nice. :slight_smile:

marcuslankenau

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.

marcuslankenau

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

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.

Where Next?

Popular in Libraries Top

achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
arkgil
Hi all! I’m happy to announce that Telemetry v0.3.0 is out! This release marks the conversion from Elixir to Erlang so that all the libr...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
Qqwy
TypeCheck: Fast and flexible runtime type-checking for your Elixir projects. Core ideas Type- and function specifications are const...
336 13801 100
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
seancribbs
Today I released a new dialyzer Mix task as the dialyzex package! At the time we started writing this task, the existing dialyzer integra...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. Features Unstyled Phoenix components. Storybook that can be added to...
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
OvermindDL1
I created a new library (rather I pulled out a couple files from my big project), it manages an operating system PID file for the BEAM. ...
New
ostinelli
Let’s write a database! Well not really, but I think it’s a little sad that there doesn’t seem to be a simple in-memory distributed KV da...
New

Other popular topics Top

freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

Sub Categories:

We're in Beta

About us Mission Statement