From a1add21aa3b716e62038d96026f5496f6db43ed5 Mon Sep 17 00:00:00 2001 From: Louis-Dominique Dubeau Date: Wed, 4 Jul 2018 10:16:22 -0400 Subject: [PATCH] fix: more namespace checks --- lib/saxes.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/saxes.js b/lib/saxes.js index afb2f99f..f88600b5 100644 --- a/lib/saxes.js +++ b/lib/saxes.js @@ -877,6 +877,10 @@ class SAXParser { case XMLNS_NAMESPACE: if (local === "") { this.fail(`The default namespace may not be set to +${XMLNS_NAMESPACE}.`); + } + else { + this.fail(`May not assign a prefix (even "xmlns") to the URI \ ${XMLNS_NAMESPACE}.`); } break; @@ -885,6 +889,9 @@ ${XMLNS_NAMESPACE}.`); this.fail(`The default namespace may not be set to ${XML_NAMESPACE}.`); } + else if (local !== "xml") { + this.fail("May not assign the xml namespace to another prefix."); + } break; default: }