you can try using getelementbytagname (check the case) function with "*" as a parameter.
check out the domcount sample, it does this.
-Vinayak
That's exactly what my getElements method does.
Actually it calls getElementsByTagNameNS with correct namespace and the string of the tag I want to count (not * because I do not want to count ALL leaves of my document, but only those underneath a given tag).
For instance, in the following example, if I want to count the number of rules in <rule> ... </rule> I
first call getElementsByTagNameNS("rule", myNameSpace).
This returns a node list, and I count the number of children each node has.
Unfortunately, this DOES count the comments, which I do not want.
<rule> <A> ... </A> <!-- My comment --> <B> ... </B> </rule>
Axelle.
Currently, I do: unsigned int count = 0;
// retrieve the NodeList of the RULES tag. DOMNodeList *sr_list = getElements(RULES);
for (int i=0; i<sr_list->getLength(); i++) { DOMNode *node = sr_list->item(i); if (node->hasChildNodes()) count += node->getChildNodes()->getLength(); }
// do not delete sr_list (to my understanding)
return count;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]