roxmltree VS quick-xml

Compare roxmltree vs quick-xml and see what are their differences.

roxmltree

Represent an XML document as a read-only tree. (by RazrFalcon)
XML
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
roxmltree quick-xml
4 4
403 1,094
- -
7.3 9.2
3 months ago 7 days ago
Rust Rust
Apache License 2.0 MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

roxmltree

Posts with mentions or reviews of roxmltree. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-09.
  • What are the scenarios where "Rewrite it in Rust" didn't meet your expectations or couldn't be successfully implemented?
    16 projects | /r/rust | 9 Jun 2023
    This is exactly what I needed when implementing xml-mut :D I have used roxmltree instead and manipulated text directly. will try to rewrite it using Xot.
  • Surprises in the Rust JSON Ecosystem
    4 projects | /r/rust | 19 Jan 2023
    In regards to the benchmarks, It makes sense to measure serializing/deserializing for parser crates. but since we are talking about dom implementations, metrics like traversal/iteration speed or insert/modification performance would be useful. a good example is roxmltree crate (readonly xml dom) which benches traversal/iteration performance and shows that by only focusing on readonly usecases, it gains substantial performance gains.
  • What are some less popular but well-made crates you'd like others to know about?
    12 projects | /r/rust | 8 Jan 2023
    For xml parsing, I find https://github.com/RazrFalcon/roxmltree as a really good crate. It’s fast, light, and well documented/maintained. I have so much respect for the maintainer’s approach to merging PRs and the way they consider what’s important for the crate
  • fast-float - a super-fast float parser in Rust
    9 projects | /r/rust | 10 Jan 2021
    I understand. But I've also wrote enough parsers and performance sensitive code in Rust (ttf-parser, tiny-skia, roxmltree). And in my experience, unsafe is not needed in 99% of the cases. Even something as performance sensitive as tiny-skia is unsafe-free (with some nuances).

quick-xml

Posts with mentions or reviews of quick-xml. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-09.
  • What are the scenarios where "Rewrite it in Rust" didn't meet your expectations or couldn't be successfully implemented?
    16 projects | /r/rust | 9 Jun 2023
    Exactly the same experience. In particular I ran into the issue that the only "ergonomic" API (that doesn't require hand-writing a parser) uses serde derive macros, but quick_xml doesn't handle namespaces. After about a day of this I stopped bike-shedding and just used lxml in Python. It works fine (and I have a large XML file, ~2.4Gb).
  • Fastest XML node parsing library in Rust
    2 projects | /r/rust | 8 Apr 2023
    You could try quick-xml.
  • Ask HN: A fast, Rust HTML parser that works?
    4 projects | news.ycombinator.com | 23 Feb 2023
    So I'm doing some web scraping in Rust, and so I will need to parse HTML. [scraper](https://docs.rs/scraper/latest/scraper/) (which uses [html5ever](https://github.com/servo/html5ever)) is doing fine except that it's the bottleneck of my application.

    So I need a faster parser. I've tried [tl](https://docs.rs/tl/latest/tl/) which would've been perfect except that it doesn't actually work on the HTML I have. When I try to `query_selector` the elements I need, it returns nothing.

    [Kuchiki](https://docs.rs/kuchiki/latest/kuchiki/) is abandonded.

    I couldn't figure out how to get [lol-html](https://github.com/cloudflare/lol-html) to work for me (it's designed for re-writing HTML, whatever that means). It doesn't seem to have an API to extract the inner text of an element.

    [html5gum](https://github.com/untitaker/html5gum) seems to be just an HTML tokenizer, or otherwise just too low-level. I have not yet tried [quick-xml](https://github.com/tafia/quick-xml/) but judging from the README, it's pretty low-level too. I mean, if these are the only options left then I will try them. Otherwise, I would love to use a parser that's faster but as ergonomic as `scraper` or `tl`.

    At this point, I would be happy with an Lxml bridge/port of some sort. I don't need to mutate HTML, just parse and read data from it.

  • Hey Rustaceans! Got an easy question? Ask here (41/2021)!
    5 projects | /r/rust | 11 Oct 2021
    This is not directly rust related, but I wanted to create some Excel document generator (and reader) library and was wondering if there are good resources available. In my limited research I tinkered with creating small documents, extracting their contents and looking at the xml inside. I‘m able to generate the same xmls using quick-xml.

What are some alternatives?

When comparing roxmltree and quick-xml you can also consider the following projects:

fast-float-rust - Super-fast float parser in Rust (now part of Rust core)

xml-rs - An XML library in Rust

json - Strongly typed JSON library for Rust

crates.io-index - Registry index for crates.io

Clipper2 - Polygon Clipping and Offsetting - C++, C# and Delphi

serde-gura - Strongly typed Gura library for Rust

log4rs - A highly configurable logging framework for Rust

vtkio - Visualization ToolKit (VTK) file parser and writer

rust - Empowering everyone to build reliable and efficient software.

tonic-example - Minimal example of using Tonic for client/server gRPC

cargo-fuzz - Command line helpers for fuzzing

exile - XML in Rust