Represent an SVG as a read-only tree

3 releases (breaking)

0.3.0 Apr 23, 2023
0.2.0 Mar 25, 2023
0.1.0 Feb 4, 2023

#239 in Parser implementations

Download history 593/week @ 2023-02-03 518/week @ 2023-02-10 863/week @ 2023-02-17 2139/week @ 2023-02-24 2208/week @ 2023-03-03 1732/week @ 2023-03-10 2451/week @ 2023-03-17 2244/week @ 2023-03-24 2905/week @ 2023-03-31 4381/week @ 2023-04-07 4463/week @ 2023-04-14 6634/week @ 2023-04-21 3985/week @ 2023-04-28 4837/week @ 2023-05-05 3037/week @ 2023-05-12

19,314 downloads per month
Used in 37 crates (via usvg-parser)




Crates.io Documentation Rust 1.65+

Represent an SVG document as a read-only tree.

Note that while this is a public crate, it's designed with usvg in mind. You should treat it is as usvg internals.


SVG is notoriously hard to parse. And while it is technically an XML superset, parsing it using just an XML library would be hard. Therefore we would be better off with a post-processed XML tree.

And this is exactly what rosvgtree does. It creates a roxmltree-like tree, but tailored to SVG parsing needs.

A complete list of post-processing steps can be found here.


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~21K SLoC