Commit eb468708 authored by Kasimier T. Buchcik's avatar Kasimier T. Buchcik
Browse files

Fixed bug #328896 reported by Liron. The path for text- and

* tree.c: Fixed bug #328896 reported by Liron. The path
  for text- and CDATA-section-nodes was computed incorrectly
  in xmlGetNodePath().
parent a29aca18
Wed Feb 15 11:55:22 CET 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
* tree.c: Fixed bug #328896 reported by Liron. The path
for text- and CDATA-section-nodes was computed incorrectly
in xmlGetNodePath().
Sun Feb 12 20:12:22 CET 2006 Daniel Veillard <daniel@veillard.com>
 
* xmlregexp.c: bug fixes for #327167 as well as some cleanups
......
......@@ -4341,21 +4341,26 @@ xmlGetNodePath(xmlNodePtr node)
*/
tmp = cur->prev;
while (tmp != NULL) {
if ((cur->type == XML_TEXT_NODE) ||
(cur->type == XML_CDATA_SECTION_NODE))
if ((tmp->type == XML_TEXT_NODE) ||
(tmp->type == XML_CDATA_SECTION_NODE))
occur++;
tmp = tmp->prev;
}
/*
* Evaluate if this is the only text- or CDATA-section-node;
* if yes, then we'll get "text()", otherwise "text()[1]".
*/
if (occur == 0) {
tmp = cur->next;
while (tmp != NULL && occur == 0) {
if ((tmp->type == XML_TEXT_NODE) ||
(tmp->type == XML_CDATA_SECTION_NODE))
occur++;
tmp = tmp->next;
}
if (occur != 0)
occur = 1;
while (tmp != NULL) {
if ((tmp->type == XML_TEXT_NODE) ||
(tmp->type == XML_CDATA_SECTION_NODE))
{
occur = 1;
break;
}
tmp = tmp->next;
}
} else
occur++;
} else if (cur->type == XML_PI_NODE) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment