Attributes don't inherit the default namespace
This commit is contained in:
parent
f8b4364acd
commit
a2aadde276
|
@ -338,6 +338,7 @@ fn named_field(
|
||||||
let field_name = field.ident.as_ref().unwrap();
|
let field_name = field.ident.as_ref().unwrap();
|
||||||
let field_tag = field_meta.tag;
|
let field_tag = field_meta.tag;
|
||||||
let default_ns = match &field_meta.ns.uri {
|
let default_ns = match &field_meta.ns.uri {
|
||||||
|
None if field_meta.attribute => &None,
|
||||||
None => &container_meta.ns.uri,
|
None => &container_meta.ns.uri,
|
||||||
_ => &field_meta.ns.uri,
|
_ => &field_meta.ns.uri,
|
||||||
};
|
};
|
||||||
|
|
|
@ -156,7 +156,7 @@ impl<'xml> Context<'xml> {
|
||||||
Some(ns) => self
|
Some(ns) => self
|
||||||
.lookup(ns)
|
.lookup(ns)
|
||||||
.ok_or_else(|| Error::UnknownPrefix(ns.to_owned()))?,
|
.ok_or_else(|| Error::UnknownPrefix(ns.to_owned()))?,
|
||||||
None => self.default_ns(),
|
None => "",
|
||||||
},
|
},
|
||||||
name: attr.local,
|
name: attr.local,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue