From e4aa28fc9bd606a0a2aa9be75a3bef6ad3b6fed7 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Wed, 18 Feb 2015 14:17:44 +0100 Subject: fixed a bug with doubled root nodes. --- src/core/parser/stack/DocumentHandler.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/core') diff --git a/src/core/parser/stack/DocumentHandler.cpp b/src/core/parser/stack/DocumentHandler.cpp index 1df3cb3..98b84c7 100644 --- a/src/core/parser/stack/DocumentHandler.cpp +++ b/src/core/parser/stack/DocumentHandler.cpp @@ -142,6 +142,14 @@ bool DocumentChildHandler::start(Variant::mapType &args) Rooted entity; // handle the root note specifically. if (parentNode->isa(&RttiTypes::Document)) { + // if we already have a root node, stop. + if (parentNode.cast()->getRoot() != nullptr) { + logger().warning( + "This document already has a root node. The additional " + "node is ignored.", + location()); + return false; + } Rooted strct = scope().resolve( Utils::split(name(), ':'), logger()); if (strct == nullptr) { -- cgit v1.2.3