minidom: enable support for writing rxml self-closing elements

This commit is contained in:
Astro 2022-04-12 20:11:39 +02:00
parent bfe2166f58
commit 3931a44d50

View file

@ -357,6 +357,7 @@ impl Element {
encoder.encode(writer::Item::Attribute(None, name, value), buf)?; encoder.encode(writer::Item::Attribute(None, name, value), buf)?;
} }
if ! self.children.is_empty() {
encoder.encode(writer::Item::ElementHeadEnd, buf)?; encoder.encode(writer::Item::ElementHeadEnd, buf)?;
for child in &self.children { for child in &self.children {
@ -370,6 +371,7 @@ impl Element {
el.write_to_inner(encoder, buf)?, el.write_to_inner(encoder, buf)?,
} }
} }
}
encoder.encode(writer::Item::ElementFoot, buf)?; encoder.encode(writer::Item::ElementFoot, buf)?;