xml: Add janky implementation for namespaces without prefix

This commit is contained in:
Lennart
2025-01-01 14:44:02 +01:00
parent 11fa0f24c7
commit 72688f1761
5 changed files with 33 additions and 5 deletions

View File

@@ -33,6 +33,7 @@ struct SetPropertyPropWrapperWrapper<T: XmlDeserialize> {
// We are <set>
#[derive(XmlDeserialize, Clone, Debug)]
struct SetPropertyElement<T: XmlDeserialize> {
#[xml(ns = "crate::namespace::NS_DAV")]
prop: T,
}
@@ -50,17 +51,21 @@ struct PropertyElement {
#[derive(XmlDeserialize, Clone, Debug)]
struct RemovePropertyElement {
#[xml(ns = "crate::namespace::NS_DAV")]
prop: PropertyElement,
}
#[derive(XmlDeserialize, Clone, Debug)]
enum Operation<T: XmlDeserialize> {
#[xml(ns = "crate::namespace::NS_DAV")]
Set(SetPropertyElement<T>),
#[xml(ns = "crate::namespace::NS_DAV")]
Remove(RemovePropertyElement),
}
#[derive(XmlDeserialize, XmlRootTag, Clone, Debug)]
#[xml(root = b"propertyupdate")]
#[xml(ns = "crate::namespace::NS_DAV")]
struct PropertyupdateElement<T: XmlDeserialize> {
#[xml(ty = "untagged", flatten)]
operations: Vec<Operation<T>>,