Example #1
0
/*GetIndex
return the index of element 
(ie. number of elements previous to this one with same tag)
*/
int CXMLElement::GetIndex()
{
	CXMLElement telement;
	telement.CopyElement(this);
	int occur = 1;
	if (!IsTextNode())
	{
		while (telement.GoPrev((char *)element->name))
			occur++;
	}
	else
	{
		while(telement.GoPrev(NULL, true))
			if (telement.IsTextNode())
				occur++;
	}
	return occur;
}