Beispiel #1
0
bool Components::ParseXMLNode( xmlDocPtr doc, xmlNodePtr node )
{
	xmlNodePtr  attr;
	Component* component = newComponent();

	// All Compoents must have names!
	if( (attr = FirstChildNamed(node,"name")) ){
		component->SetName(NodeToString(doc,attr));
	} else {
		LogMsg(ERR,"Failed to find a name attribute for the %s node at line %d.\n", NodeToString(doc,attr).c_str(), xmlGetLineNo(node) );
		return false;
	}

	if( component->FromXMLNode(doc, node) ){
		Add( component );
		return true;
	}
	return false;
}