Skip to content

Commit

Permalink
fix: more namespace checks
Browse files Browse the repository at this point in the history
  • Loading branch information
lddubeau committed Jul 4, 2018
1 parent 4a1c99f commit a1add21
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/saxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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:
}
Expand Down

0 comments on commit a1add21

Please sign in to comment.