diff --git a/src/name.rs b/src/name.rs index 59498e86..ab4eeaa6 100644 --- a/src/name.rs +++ b/src/name.rs @@ -493,15 +493,11 @@ impl NamespaceResolver { } Some(PrefixDeclaration::Named(prefix)) => { let start = buffer.len(); + let ns = Namespace(&v); - if v == RESERVED_NAMESPACE_XMLNS.1.into_inner() { - // error, non-`xmlns` prefix set to xmlns uri - return Err(Error::ReservedNamespaceError { - prefix: String::from_utf8(prefix.to_vec()).unwrap(), - name: String::from_utf8(v.to_vec()).unwrap(), - }); - } else if v == RESERVED_NAMESPACE_XML.1.into_inner() { + if ns == RESERVED_NAMESPACE_XML.1 || ns == RESERVED_NAMESPACE_XMLNS.1 { // error, non-`xml` prefix set to xml uri + // error, non-`xmlns` prefix set to xmlns uri return Err(Error::ReservedNamespaceError { prefix: String::from_utf8(prefix.to_vec()).unwrap(), name: String::from_utf8(v.to_vec()).unwrap(),