diff options
Diffstat (limited to 'project2/xmlScriptParser.cpp')
-rw-r--r-- | project2/xmlScriptParser.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/project2/xmlScriptParser.cpp b/project2/xmlScriptParser.cpp index fad9542..6d30d67 100644 --- a/project2/xmlScriptParser.cpp +++ b/project2/xmlScriptParser.cpp @@ -4,14 +4,16 @@ XmlScriptParser::XmlScriptParser(const std::string & group, const std::string & name, bool ii) : IsInclusion(ii), - loader(true) + loader(true), + documentParsed(false) { loadDocument(group + "/" + name + ".xml"); } XmlScriptParser::XmlScriptParser(const std::string & file, bool ii) : IsInclusion(ii), - loader(true) + loader(true), + documentParsed(false) { loadDocument(file); } @@ -42,8 +44,11 @@ XmlScriptParser::loadDocument(const std::string & file) } void -XmlScriptParser::parseDocument() +XmlScriptParser::parseDocument() const { - loader.collectAll(this, get_document()->get_root_node(), true, ErrorOnUnsupported); + if (!documentParsed) { + loader.collectAll(this, get_document()->get_root_node(), true, ErrorOnUnsupported); + documentParsed = true; + } } |