mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-01 10:06:59 +03:00
More work on XPointer
- xpath.c xpointer.c: XPointer reorder of ranges start/end and string-range for empty strings - test/XPath/docs/str test/XPath/xptr/chaptersrange test/XPath/xptr/strrange: augmented the XPointer testsuite Daniel
This commit is contained in:
8
xpath.c
8
xpath.c
@ -2692,9 +2692,9 @@ xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
void
|
||||
xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
CHECK_ARITY(0);
|
||||
if (ctxt->context->proximityPosition > 0) {
|
||||
if (ctxt->context->proximityPosition >= 0) {
|
||||
valuePush(ctxt,
|
||||
xmlXPathNewFloat((double) ctxt->context->proximityPosition));
|
||||
xmlXPathNewFloat((double) ctxt->context->proximityPosition));
|
||||
#ifdef DEBUG_EXPR
|
||||
fprintf(xmlXPathDebug, "position() : %d\n",
|
||||
ctxt->context->proximityPosition);
|
||||
@ -4772,14 +4772,14 @@ xmlXPathEvalPredicate(xmlXPathParserContextPtr ctxt) {
|
||||
ctxt->context->node = NULL;
|
||||
|
||||
if ((oldset == NULL) || (oldset->nodeNr == 0)) {
|
||||
xmlXPathEvalExpr(ctxt);
|
||||
CHECK_ERROR;
|
||||
ctxt->context->contextSize = 0;
|
||||
ctxt->context->proximityPosition = 0;
|
||||
xmlXPathEvalExpr(ctxt);
|
||||
res = valuePop(ctxt);
|
||||
if (res != NULL)
|
||||
xmlXPathFreeObject(res);
|
||||
valuePush(ctxt, obj);
|
||||
CHECK_ERROR;
|
||||
} else {
|
||||
/*
|
||||
* Save the expression pointer since we will have to evaluate
|
||||
|
Reference in New Issue
Block a user