1
0
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:
Daniel Veillard
2000-10-13 16:38:25 +00:00
parent 189446d2fa
commit ff9c330753
8 changed files with 202 additions and 63 deletions

View File

@ -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