https://github.com/mitsuhiko/elementtree-rust
Port of the Python element tree library to Rust
https://github.com/mitsuhiko/elementtree-rust
Last synced: 3 months ago
JSON representation
Port of the Python element tree library to Rust
- Host: GitHub
- URL: https://github.com/mitsuhiko/elementtree-rust
- Owner: mitsuhiko
- License: mit
- Created: 2017-03-28T14:09:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T20:45:15.000Z (about 2 years ago)
- Last Synced: 2025-03-30T06:10:16.181Z (3 months ago)
- Language: Rust
- Homepage: https://docs.rs/elementtree
- Size: 65.4 KB
- Stars: 61
- Watchers: 4
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ElementTree for Rust
[](https://github.com/mitsuhiko/elementtree-rust/actions?query=workflow%3ATests)
[](https://crates.io/crates/elementtree)
[](https://github.com/mitsuhiko/elementtree-rust/blob/master/LICENSE)
[](https://img.shields.io/badge/rust-1.56%2B-orange.svg)
[](https://docs.rs/elementtree)This library parses XML into a Python ElementTree like structure. It currently
has basic support for reading and writing with pretty good namespace support and the
ability to inspect the file.It's not recommended to use this for larger documents as the entire document
will be loaded into memory. However it's pretty good for working with configuration
files and similar things.## Example
```rust
let root = Element::from_reader(r#"
"#.as_bytes()).unwrap();
let list = root.find("{tag:myns}list").unwrap();
for child in list.find_all("{tag:myns}item") {
println!("attribute: {}", child.get_attr("{tag:otherns}attr").unwrap());
}
```## License and Links
- [Documentation](https://docs.rs/elementtree/)
- [Issue Tracker](https://github.com/mitsuhiko/elementtree-rust/issues)
- [Examples](https://github.com/mitsuhiko/elementtree-rust/tree/master/examples)
- License: [MIT](https://github.com/mitsuhiko/elementtree-rust/blob/master/LICENSE)