Attributes don't inherit the default namespace

This commit is contained in:
Dirkjan Ochtman 2022-11-29 14:24:19 +01:00
parent f8b4364acd
commit a2aadde276
2 changed files with 2 additions and 1 deletions

View File

@ -338,6 +338,7 @@ fn named_field(
let field_name = field.ident.as_ref().unwrap();
let field_tag = field_meta.tag;
let default_ns = match &field_meta.ns.uri {
None if field_meta.attribute => &None,
None => &container_meta.ns.uri,
_ => &field_meta.ns.uri,
};

View File

@ -156,7 +156,7 @@ impl<'xml> Context<'xml> {
Some(ns) => self
.lookup(ns)
.ok_or_else(|| Error::UnknownPrefix(ns.to_owned()))?,
None => self.default_ns(),
None => "",
},
name: attr.local,
})