Commit dd5eeb0a authored by Kenneth Leiter's avatar Kenneth Leiter

BUG: Fix bug in parse() function that only allowed correct parsing when Xdmf

fragment was surrounded by an <Xdmf> tag.
parent 48c377c3
......@@ -283,8 +283,15 @@ XdmfCoreReader::parse(const std::string & lightData) const
{
mImpl->parse(lightData);
const xmlNodePtr currNode = xmlDocGetRootElement(mImpl->mDocument);
const std::vector<shared_ptr<XdmfItem> > toReturn =
mImpl->read(currNode->children);
std::vector<shared_ptr<XdmfItem> > toReturn;
if(mImpl->mItemFactory->createItem((const char*)currNode->name,
std::map<std::string, std::string>(),
std::vector<shared_ptr<XdmfItem> >()) == NULL) {
toReturn = mImpl->read(currNode->children);
}
else {
toReturn = mImpl->read(currNode);
}
mImpl->closeFile();
return(toReturn[0]);
}
......
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