Commit 88949d58 authored by Chris Cantwell's avatar Chris Cantwell

Issue warning and ignore empty XML

tags which replace non-empty tags.
parent d393639c
......@@ -1463,12 +1463,26 @@ namespace Nektar
{
TiXmlElement *vMainEntry =
vMainNektar->FirstChildElement(p->Value());
TiXmlElement *q = new TiXmlElement(*p);
if (vMainEntry)
// First check if the new item is in fact blank
if (!p->FirstChild() && vMainEntry)
{
std::string warningmsg =
"File " + pFilenames[i] + " contains " +
"an empty XML element " +
std::string(p->Value()) +
" which will be ignored.";
WARNINGL0(false, warningmsg.c_str());
}
else
{
vMainNektar->RemoveChild(vMainEntry);
if (vMainEntry)
{
vMainNektar->RemoveChild(vMainEntry);
}
TiXmlElement *q = new TiXmlElement(*p);
vMainNektar->LinkEndChild(q);
}
vMainNektar->LinkEndChild(q);
p = p->NextSiblingElement();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment