mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 11:42:25 +00:00
xml: Add namespace prefixes
This commit is contained in:
@@ -98,4 +98,5 @@ impl XmlDeserialize for Unparsed {
|
||||
pub trait XmlRootTag {
|
||||
fn root_tag() -> &'static [u8];
|
||||
fn root_ns() -> Option<Namespace<'static>>;
|
||||
fn root_ns_prefixes() -> HashMap<Namespace<'static>, &'static [u8]>;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ impl<T: XmlSerialize + XmlRootTag> XmlSerializeRoot for T {
|
||||
&self,
|
||||
writer: &mut quick_xml::Writer<W>,
|
||||
) -> std::io::Result<()> {
|
||||
let namespaces = HashMap::new();
|
||||
let namespaces = Self::root_ns_prefixes();
|
||||
self.serialize(Self::root_ns(), Some(Self::root_tag()), &namespaces, writer)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user