Skip to content
Snippets Groups Projects
Commit b68c42a9 authored by Tinny Ng's avatar Tinny Ng
Browse files

Correct count element routine.

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@173592 13f79535-47bb-0310-9956-ffa450edef68
parent cf37c90c
No related branches found
No related tags found
No related merge requests found
...@@ -112,16 +112,9 @@ static int countChildElements(IDOM_Node *n) ...@@ -112,16 +112,9 @@ static int countChildElements(IDOM_Node *n)
int count = 0; int count = 0;
if (n) { if (n) {
if (n->getNodeType() == IDOM_Node::ELEMENT_NODE) if (n->getNodeType() == IDOM_Node::ELEMENT_NODE)
{
count++; count++;
for (child = n->getFirstChild(); child != 0; child=child->getNextSibling()) for (child = n->getFirstChild(); child != 0; child=child->getNextSibling())
{ count += countChildElements(child);
if (child->getNodeType() == IDOM_Node::ELEMENT_NODE)
{
count += countChildElements(child);
}
}
}
} }
return count; return count;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment