Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mitsuhiko/elementtree-rust
Port of the Python element tree library to Rust
https://github.com/mitsuhiko/elementtree-rust
Last synced: 4 days 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 (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-22T20:45:15.000Z (over 1 year ago)
- Last Synced: 2024-12-23T10:31:35.675Z (11 days ago)
- Language: Rust
- Homepage: https://docs.rs/elementtree
- Size: 65.4 KB
- Stars: 61
- Watchers: 5
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ElementTree for Rust
[![Build Status](https://github.com/mitsuhiko/elementtree-rust/workflows/Tests/badge.svg?branch=master)](https://github.com/mitsuhiko/elementtree-rust/actions?query=workflow%3ATests)
[![Crates.io](https://img.shields.io/crates/d/elementtree.svg)](https://crates.io/crates/elementtree)
[![License](https://img.shields.io/github/license/mitsuhiko/elementtree-rust)](https://github.com/mitsuhiko/elementtree-rust/blob/master/LICENSE)
[![rustc 1.56.0](https://img.shields.io/badge/rust-1.56%2B-orange.svg)](https://img.shields.io/badge/rust-1.56%2B-orange.svg)
[![Documentation](https://docs.rs/elementtree/badge.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)