Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/xml_parsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void VerifyXML(const std::string& xml_text,
{
const char* name = node->Name();
if (StrEqual(name, "Action") || StrEqual(name, "Decorator") ||
StrEqual(name, "SubTree") || StrEqual(name, "Condition"))
StrEqual(name, "SubTree") || StrEqual(name, "Condition") || StrEqual(name, "Control"))
{
const char* ID = node->Attribute("ID");
if (!ID)
Expand Down Expand Up @@ -309,6 +309,19 @@ void VerifyXML(const std::string& xml_text,
"The node <Condition> must have the attribute [ID]");
}
}
else if (StrEqual(name, "Control"))
{
if (children_count == 0)
{
ThrowError(node->GetLineNum(),
"The node <Control> must have at least 1 child");
}
if (!node->Attribute("ID"))
{
ThrowError(node->GetLineNum(),
"The node <Control> must have the attribute [ID]");
}
}
else if (StrEqual(name, "Sequence") ||
StrEqual(name, "SequenceStar") ||
StrEqual(name, "Fallback") )
Expand Down Expand Up @@ -443,7 +456,8 @@ TreeNode::Ptr XMLParser::Pimpl::createNodeFromXML(const XMLElement *element,
std::string instance_name;

// Actions and Decorators have their own ID
if (element_name == "Action" || element_name == "Decorator" || element_name == "Condition")
if (element_name == "Action" || element_name == "Decorator" ||
element_name == "Condition" || element_name == "Control")
{
ID = element->Attribute("ID");
}
Expand Down