summaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tree.c b/tree.c
index faf33f7a..7177ae6c 100644
--- a/tree.c
+++ b/tree.c
@@ -3484,7 +3484,8 @@ xmlGetNodePath(xmlNodePtr node)
*/
tmp = cur->prev;
while (tmp != NULL) {
- if (xmlStrEqual(cur->name, tmp->name))
+ if ((tmp->type == XML_ELEMENT_NODE) &&
+ (xmlStrEqual(cur->name, tmp->name)))
occur++;
tmp = tmp->prev;
}