Crates.io | ogrim |
lib.rs | ogrim |
version | 0.1.1 |
source | src |
created_at | 2023-11-14 09:08:31.34464 |
updated_at | 2023-11-15 10:46:20.307595 |
description | XML builder macro letting you write literal XML inside your Rust code (similar to `serde_json::json!`). Features interpolation, escaping, auto-close tags and minimal memory allocations. |
homepage | |
repository | https://github.com/elan-ev/ogrim/ |
max_upload_size | |
id | 1034528 |
size | 36,858 |
ogrim
: macro for building XML from inline XMLXML builder macro letting you write XML inside Rust code (similar to serde_json::json!
).
Features:
<foo {..iter}>
<foo>"body"</>
)String
being built allocates)use ogrim::xml;
let cat_name = "Tony";
let doc = xml!(
<?xml version="1.0" ?>
<zoo name="Lorem Ipsum" openingYear={2000 + 13}>
<cat>{cat_name}</>
<dog>"Barbara"</>
</>
);
println!("{}", doc.as_str()); // Print XML
See the documentation for more information and examples.
Licensed under either of Apache License, Version 2.0 or MIT license at your option. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.