1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-21 14:53:44 +03:00

fixed problem with union when last() is used in predicate (bug #131971)

* xpath.c: fixed problem with union when last() is used
  in predicate (bug #131971)
* xpointer.c: minor change to comment for doc generation
This commit is contained in:
William M. Brack
2004-01-22 02:47:18 +00:00
parent ae28918bf5
commit ce4fc56e1b
3 changed files with 19 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
Thu Jan 22 10:43:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
* xpath.c: fixed problem with union when last() is used
in predicate (bug #131971)
* xpointer.c: minor change to comment for doc generation
Wed Jan 21 17:03:17 CET 2004 Daniel Veillard <daniel@veillard.com> Wed Jan 21 17:03:17 CET 2004 Daniel Veillard <daniel@veillard.com>
* parser.c: fixed bug #131745 raised by Shaun McCance with the * parser.c: fixed bug #131745 raised by Shaun McCance with the

12
xpath.c
View File

@@ -9846,6 +9846,10 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op,
int total = 0, cur; int total = 0, cur;
xmlXPathCompExprPtr comp; xmlXPathCompExprPtr comp;
xmlXPathObjectPtr arg1, arg2; xmlXPathObjectPtr arg1, arg2;
xmlNodePtr bak;
xmlDocPtr bakd;
int pp;
int cs;
CHECK_ERROR0; CHECK_ERROR0;
comp = ctxt->comp; comp = ctxt->comp;
@@ -9853,6 +9857,10 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op,
case XPATH_OP_END: case XPATH_OP_END:
return (0); return (0);
case XPATH_OP_UNION: case XPATH_OP_UNION:
bakd = ctxt->context->doc;
bak = ctxt->context->node;
pp = ctxt->context->proximityPosition;
cs = ctxt->context->contextSize;
total = total =
xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last); xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
CHECK_ERROR0; CHECK_ERROR0;
@@ -9869,6 +9877,10 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op,
nodesetval->nodeNr - nodesetval->nodeNr -
1]; 1];
} }
ctxt->context->doc = bakd;
ctxt->context->node = bak;
ctxt->context->proximityPosition = pp;
ctxt->context->contextSize = cs;
cur = cur =
xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last); xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
CHECK_ERROR0; CHECK_ERROR0;

View File

@@ -2290,6 +2290,7 @@ xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt, int nargs) {
/** /**
* xmlXPtrAdvanceNode: * xmlXPtrAdvanceNode:
* @cur: the node * @cur: the node
* @level: incremented/decremented to show level in tree
* *
* Advance to the next element or text node in document order * Advance to the next element or text node in document order
* TODO: add a stack for entering/exiting entities * TODO: add a stack for entering/exiting entities