Welcome! Log In Create A New Profile

Advanced

Count the number of child in a node with mxml

Posted by Crayon 
Count the number of child in a node with mxml
November 25, 2008 05:45AM
Hi, I want to count the number of child within a node with mxml. I guess there must be a function for that, but since I don't know it I use my own. So if you know something faster, please let know.
unsigned int ChildCount(mxml_node_t *Up_Node, const char *Name)
{
	int Count = 0;

	if(Up_Node)
	{
		mxml_node_t *Message_Node = NULL;
		for(Message_Node = mxmlFindElement(Up_Node, Up_Node, Name, NULL, NULL, MXML_DESCEND); 
			Message_Node != NULL; 
			Message_Node = mxmlFindElement(Message_Node, Up_Node, Name, NULL, NULL, MXML_DESCEND))
		{
			Count++;
		}
	}
	return Count;
}

I found nothing on the Web site: [www.minixml.org]

Thanks,

Crayon
Sorry, only registered users may post in this forum.

Click here to login