mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
minidom: enable support for writing rxml self-closing elements
This commit is contained in:
parent
bfe2166f58
commit
3931a44d50
1 changed files with 11 additions and 9 deletions
|
@ -357,17 +357,19 @@ impl Element {
|
|||
encoder.encode(writer::Item::Attribute(None, name, value), buf)?;
|
||||
}
|
||||
|
||||
encoder.encode(writer::Item::ElementHeadEnd, buf)?;
|
||||
if ! self.children.is_empty() {
|
||||
encoder.encode(writer::Item::ElementHeadEnd, buf)?;
|
||||
|
||||
for child in &self.children {
|
||||
match child {
|
||||
Node::Text(s) => {
|
||||
let text = CDataStr::from_str(s)
|
||||
.map_err(::rxml::error::Error::NotWellFormed)?;
|
||||
encoder.encode(writer::Item::Text(text), buf)?;
|
||||
for child in &self.children {
|
||||
match child {
|
||||
Node::Text(s) => {
|
||||
let text = CDataStr::from_str(s)
|
||||
.map_err(::rxml::error::Error::NotWellFormed)?;
|
||||
encoder.encode(writer::Item::Text(text), buf)?;
|
||||
}
|
||||
Node::Element(el) =>
|
||||
el.write_to_inner(encoder, buf)?,
|
||||
}
|
||||
Node::Element(el) =>
|
||||
el.write_to_inner(encoder, buf)?,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue