diff --git a/ChangeLog b/ChangeLog index 95805284..5be37240 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Oct 8 10:25:07 CEST 2002 Daniel Veillard + + * tree.c: patch from Mark Vakoc to fix xmlNodeGetPath() + Mon Oct 7 13:12:03 CEST 2002 Daniel Veillard * doc/index.py: improved HTML indexing diff --git a/tree.c b/tree.c index ca050f73..c7b2a5ae 100644 --- a/tree.c +++ b/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; diff --git a/valid.c b/valid.c index 196ea2b9..df1e6efc 100644 --- a/valid.c +++ b/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 */