improvement "xml::ElementParseCreater" root element parse

This commit is contained in:
hyzboy 2020-09-02 13:04:55 +08:00
parent 20fcbc2a02
commit 3ddc2d1f4e

View File

@ -17,6 +17,8 @@ namespace hgl
ElementCreater *ec=nullptr; ElementCreater *ec=nullptr;
if(!cur_ec)
{
if(ecs_stack.GetCount()==0) //根 if(ecs_stack.GetCount()==0) //根
{ {
if(!ecs_map.Get(element_name,ec)) if(!ecs_map.Get(element_name,ec))
@ -24,9 +26,11 @@ namespace hgl
} }
else else
{ {
if(!cur_ec)
return(false); return(false);
}
}
else
{
ec=cur_ec->GetSubElementCreater(element_name); ec=cur_ec->GetSubElementCreater(element_name);
ecs_stack.Push(cur_ec); ecs_stack.Push(cur_ec);
} }