summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 765843fbc..30b616324 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1350,7 +1350,7 @@ static void visit_one_node(xmlNode *node)
return;
/* Don't print out the node name if it is "text" */
- if (!strcmp(node->name, "text"))
+ while (!node->name || !strcmp(node->name, "text"))
node = node->parent;
name = nodename(node, buffer, sizeof(buffer));
@@ -1438,6 +1438,11 @@ static void traverse(xmlNode *root)
for (n = root; n; n = n->next) {
struct nesting *rule = nesting;
+ if (!n->name) {
+ visit(n);
+ continue;
+ }
+
do {
if (!strcmp(rule->name, n->name))
break;