mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-07 06:43:02 +03:00
patch from Mark Vakoc to fix xmlNodeGetPath() Daniel
* tree.c: patch from Mark Vakoc to fix xmlNodeGetPath() Daniel
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
Tue Oct 8 10:25:07 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* tree.c: patch from Mark Vakoc to fix xmlNodeGetPath()
|
||||
|
||||
Mon Oct 7 13:12:03 CEST 2002 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* doc/index.py: improved HTML indexing
|
||||
|
14
tree.c
14
tree.c
@@ -3438,7 +3438,7 @@ xmlGetNodePath(xmlNodePtr node)
|
||||
xmlChar *buffer = NULL, *temp;
|
||||
size_t buf_len;
|
||||
xmlChar *buf;
|
||||
char sep;
|
||||
char *sep;
|
||||
const char *name;
|
||||
char nametemp[100];
|
||||
int occur = 0;
|
||||
@@ -3460,16 +3460,16 @@ xmlGetNodePath(xmlNodePtr node)
|
||||
cur = node;
|
||||
do {
|
||||
name = "";
|
||||
sep = '?';
|
||||
sep = "?";
|
||||
occur = 0;
|
||||
if ((cur->type == XML_DOCUMENT_NODE) ||
|
||||
(cur->type == XML_HTML_DOCUMENT_NODE)) {
|
||||
if (buffer[0] == '/')
|
||||
break;
|
||||
sep = '/';
|
||||
sep = "/";
|
||||
next = NULL;
|
||||
} else if (cur->type == XML_ELEMENT_NODE) {
|
||||
sep = '/';
|
||||
sep = "/";
|
||||
name = (const char *) cur->name;
|
||||
if (cur->ns) {
|
||||
snprintf(nametemp, sizeof(nametemp) - 1,
|
||||
@@ -3501,7 +3501,7 @@ xmlGetNodePath(xmlNodePtr node)
|
||||
} else
|
||||
occur++;
|
||||
} else if (cur->type == XML_ATTRIBUTE_NODE) {
|
||||
sep = '@';
|
||||
sep = "/@";
|
||||
name = (const char *) (((xmlAttrPtr) cur)->name);
|
||||
next = ((xmlAttrPtr) cur)->parent;
|
||||
} else {
|
||||
@@ -3530,10 +3530,10 @@ xmlGetNodePath(xmlNodePtr node)
|
||||
buf = temp;
|
||||
}
|
||||
if (occur == 0)
|
||||
snprintf((char *) buf, buf_len, "%c%s%s",
|
||||
snprintf((char *) buf, buf_len, "%s%s%s",
|
||||
sep, name, (char *) buffer);
|
||||
else
|
||||
snprintf((char *) buf, buf_len, "%c%s[%d]%s",
|
||||
snprintf((char *) buf, buf_len, "%s%s[%d]%s",
|
||||
sep, name, occur, (char *) buffer);
|
||||
snprintf((char *) buffer, buf_len, "%s", buf);
|
||||
cur = next;
|
||||
|
5
valid.c
5
valid.c
@@ -2169,8 +2169,9 @@ xmlFreeIDTable(xmlIDTablePtr table) {
|
||||
* @attr: the attribute
|
||||
*
|
||||
* Determine whether an attribute is of type ID. In case we have DTD(s)
|
||||
* then this is simple, otherwise we use an heuristic: name ID (upper
|
||||
* or lowercase).
|
||||
* then this is done if DTD loading has been requested. In the case
|
||||
* of HTML documents parsed with the HTML parser, then ID detection is
|
||||
* done systematically.
|
||||
*
|
||||
* Returns 0 or 1 depending on the lookup result
|
||||
*/
|
||||
|
Reference in New Issue
Block a user