@@ -251,7 +251,7 @@ void VerifyXML(const std::string& xml_text,
251
251
{
252
252
const char * name = node->Name ();
253
253
if (StrEqual (name, " Action" ) || StrEqual (name, " Decorator" ) ||
254
- StrEqual (name, " SubTree" ) || StrEqual (name, " Condition" ))
254
+ StrEqual (name, " SubTree" ) || StrEqual (name, " Condition" ) || StrEqual (name, " Control " ) )
255
255
{
256
256
const char * ID = node->Attribute (" ID" );
257
257
if (!ID)
@@ -309,6 +309,19 @@ void VerifyXML(const std::string& xml_text,
309
309
" The node <Condition> must have the attribute [ID]" );
310
310
}
311
311
}
312
+ else if (StrEqual (name, " Control" ))
313
+ {
314
+ if (children_count == 0 )
315
+ {
316
+ ThrowError (node->GetLineNum (),
317
+ " The node <Control> must have at least 1 child" );
318
+ }
319
+ if (!node->Attribute (" ID" ))
320
+ {
321
+ ThrowError (node->GetLineNum (),
322
+ " The node <Control> must have the attribute [ID]" );
323
+ }
324
+ }
312
325
else if (StrEqual (name, " Sequence" ) ||
313
326
StrEqual (name, " SequenceStar" ) ||
314
327
StrEqual (name, " Fallback" ) )
@@ -443,7 +456,8 @@ TreeNode::Ptr XMLParser::Pimpl::createNodeFromXML(const XMLElement *element,
443
456
std::string instance_name;
444
457
445
458
// Actions and Decorators have their own ID
446
- if (element_name == " Action" || element_name == " Decorator" || element_name == " Condition" )
459
+ if (element_name == " Action" || element_name == " Decorator" ||
460
+ element_name == " Condition" || element_name == " Control" )
447
461
{
448
462
ID = element->Attribute (" ID" );
449
463
}
0 commit comments