inhibited production of "(null):" in xmlGetNodePath when node has default

* tree.c: inhibited production of "(null):" in xmlGetNodePath
  when node has default namespace (Bug 129710)
This commit is contained in:
William M. Brack 2003-12-23 03:45:17 +00:00
parent e8d1bd9daa
commit 84d83e3464
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Tue Dec 23 11:41:42 HKT 2003 William Brack <wbrack@mmm.com.hk>
* tree.c: inhibited production of "(null):" in xmlGetNodePath
when node has default namespace (Bug 129710)
Tue Dec 23 09:29:14 HKT 2003 William Brack <wbrack@mmm.com.hk>
* xpath.c: small enhancement to xmlXPathCmpNodes to assure

6
tree.c
View File

@ -4161,8 +4161,12 @@ xmlGetNodePath(xmlNodePtr node)
sep = "/";
name = (const char *) cur->name;
if (cur->ns) {
snprintf(nametemp, sizeof(nametemp) - 1,
if (cur->ns->prefix != NULL)
snprintf(nametemp, sizeof(nametemp) - 1,
"%s:%s", cur->ns->prefix, cur->name);
else
snprintf(nametemp, sizeof(nametemp) - 1,
"%s", cur->name);
nametemp[sizeof(nametemp) - 1] = 0;
name = nametemp;
}