diff --git a/parsers/src/presence.rs b/parsers/src/presence.rs index 35d0a564..6d51263d 100644 --- a/parsers/src/presence.rs +++ b/parsers/src/presence.rs @@ -370,6 +370,28 @@ impl From for Element { } } +impl ::xso::FromXml for Presence { + type Builder = ::xso::minidom_compat::FromEventsViaElement; + + fn from_events( + qname: ::xso::exports::rxml::QName, + attrs: ::xso::exports::rxml::AttrMap, + ) -> Result { + if qname.0 != crate::ns::DEFAULT_NS || qname.1 != "presence" { + return Err(::xso::error::FromEventsError::Mismatch { name: qname, attrs }); + } + Self::Builder::new(qname, attrs) + } +} + +impl ::xso::AsXml for Presence { + type ItemIter<'x> = ::xso::minidom_compat::AsItemsViaElement<'x>; + + fn as_xml_iter(&self) -> Result, ::xso::error::Error> { + ::xso::minidom_compat::AsItemsViaElement::new(self.clone()) + } +} + #[cfg(test)] mod tests { use super::*;