macro_rules! macro_write_element {
($writer:expr, $name:expr, $content:expr) => { ... };
}
Expand description
Writes an XML element with the given name and content.
This macro is used internally by the macro_generate_rss
macro to write individual XML elements.
§Arguments
$writer
- The Writer instance to write the XML element.$name
- The name of the XML element.$content
- The content of the XML element.
§Example
use rss_gen::macro_write_element;
use quick_xml::Writer;
use std::io::Cursor;
use quick_xml::events::{BytesStart, BytesEnd, BytesText, Event};
fn _doctest_main_rss_gen_src_macros_rs_153_0() -> Result<(), Box<dyn std::error::Error>> {
let mut writer = Writer::new(Cursor::new(Vec::new()));
macro_write_element!(writer, "title", "My Blog").unwrap();
Ok(())
}