Represent an XML as a read-only tree.
open sourceMIT OR Apache-2.0self-hostablefree
roxmltree parses an XML document into a read-only tree, which makes it fast for reading data out of XML. It resolves element and attribute namespaces and entity and character references, keeps positions, and mimics the parsing behaviour of Python's lxml. It has no dependencies and no unsafe code, and refuses DTDs unless told to allow them, so untrusted input can't trigger entity expansion attacks.
Problems it solves
- read values out of an XML file in Rust without a heavy dependency
- check that an uploaded SVG is well-formed XML with an svg root element
- parse untrusted XML without being exposed to billion laughs entity expansion
- find an element by attribute in an XML document from Rust
- parse XML with namespaces correctly in Rust
- I only need to read XML, not edit or write it
- a pure Rust XML parser with no unsafe code and no dependencies
- get line and column positions for elements in parsed XML
Features
- read-only tree
- namespace resolution
- entity and character references
- position preserving
- no dependencies
- no unsafe code
- DTDs refused by default
Capabilities
| Has official SDKs | plan not known |
|---|
