This commit is contained in:
Dirkjan Ochtman 2022-09-01 09:44:59 +02:00
parent c341dcb73c
commit 04a74637c8
2 changed files with 6 additions and 6 deletions

View File

@ -260,8 +260,8 @@ impl Deserializer {
match def_prefix {
Some(def_prefix) => {
// Check if defined and gotten namespaces equals for each field
if deserializer.get_parser_namespace(&parser_prefix)
!= deserializer.get_def_namespace(def_prefix) {
if deserializer.parser_namespace(&parser_prefix)
!= deserializer.default_namespace(def_prefix) {
return Err(Error::WrongNamespace)
}
}

View File

@ -236,12 +236,12 @@ impl<'xml> Deserializer<'xml> {
self.parser.peek_next_tag()
}
pub fn get_def_namespace(&self, prefix: &str) -> Option<&&str> {
self.def_namespaces.get(prefix)
pub fn default_namespace(&self, prefix: &str) -> Option<&str> {
self.def_namespaces.get(prefix).map(|&ns| ns)
}
pub fn get_parser_namespace(&self, prefix: &str) -> Option<&&str> {
self.parser_namespaces.get(prefix)
pub fn parser_namespace(&self, prefix: &str) -> Option<&str> {
self.parser_namespaces.get(prefix).map(|&ns| ns)
}
pub fn compare_parser_and_def_default_namespaces(&self) -> bool {