marcuslankenau

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

Showing Posts 15 to 6

dimitarvp

dimitarvp

Sadly no. I was looking for a way to replace values by my own user-supplied function – not by a hardcoded value (example: reverse the value).

I coded it myself through xmerl’s streaming functions.

BrightEyesDavid

BrightEyesDavid

OvermindDL1

OvermindDL1

Yeah it is for reading only, which is all I need (I’m eating old XML and converting to better formats). ^.^

Heh, they aren’t too bad, you haven’t used C libs. :wink:

dimitarvp

dimitarvp

Shame. Seems I have to use one of the Erlang libraries then. :icon_eek: They are quite cryptic and manual and verbose.

mischov

mischov

No. Meeseeks doesn’t do modification of a document, just search.

dimitarvp

dimitarvp

What about mutating the XML structure and writing it back to disk? Can it do that in combination with XPath?

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.

Cruz

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

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.

marcuslankenau

marcuslankenau OP

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.

Where Next? Top

Trending in Announcing Top

woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
MRdotB
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
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
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
anuaralfetahe
Hello Published a new library - ProcessHub! ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
sergio
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
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews