Struct xmlem::Declaration
source · pub struct Declaration {
pub version: Option<String>,
pub encoding: Option<String>,
pub standalone: Option<String>,
}
Fields§
§version: Option<String>
§encoding: Option<String>
§standalone: Option<String>
Implementations§
source§impl Declaration
impl Declaration
pub fn v1_0() -> Self
sourcepub fn v1_1() -> Self
pub fn v1_1() -> Self
Examples found in repository?
examples/readme.rs (line 17)
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
fn main() {
let mut doc = Document::from_str("<root><potato /></root>").unwrap();
let root = doc.root();
let potato = root
.query_selector(&doc, &Selector::new("potato").unwrap())
.unwrap();
potato.append_new_element(
&mut doc,
("wow", [("easy", "true"), ("x", "200"), ("a-null", "\0")]),
);
let decl = Declaration::v1_1();
doc.set_declaration(Some(decl));
doc.set_doctype(Some("not-html"));
println!("{}", doc.to_string_pretty());
}
Trait Implementations§
source§impl Clone for Declaration
impl Clone for Declaration
source§fn clone(&self) -> Declaration
fn clone(&self) -> Declaration
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more