diff --git a/lib/saxes.js b/lib/saxes.js index eb7df19f..f6516011 100644 --- a/lib/saxes.js +++ b/lib/saxes.js @@ -1023,6 +1023,9 @@ ${XML_NAMESPACE}.`); tag.isSelfClosing = !!selfClosing; // process the tag + if (this.closedRoot) { + this.fail("Documents may contain only one root."); + } this.sawRoot = true; this.tags.push(tag); this.emitNode("onopentag", tag);