diff --git a/lib/saxes.js b/lib/saxes.js index a8a7d06d..40aa4603 100644 --- a/lib/saxes.js +++ b/lib/saxes.js @@ -885,9 +885,11 @@ class SAXParser { let { ns } = tag; let disconnectedNS = false; - for (const [name, uri] of this.attribList) { + // eslint-disable-next-line prefer-const + for (let [name, uri] of this.attribList) { const { prefix, local } = this.qname(name, true); if (prefix === "xmlns") { + uri = uri.trim(); // namespace binding attribute. push the binding into scope if (local === "xml" && uri !== XML_NAMESPACE) { this.fail(`xml: prefix must be bound to ${XML_NAMESPACE}\n` +