* Fixed: [xpath // abbreviation does not work other than on the top-level](https://github.com/clicon/clixon/issues/435)

This commit is contained in:
Olof hagsand 2023-06-21 11:45:49 +02:00
parent 0460c093cc
commit 79d1d2e95a
3 changed files with 24 additions and 5 deletions

View file

@ -1287,8 +1287,12 @@ xp_eval(xp_ctx *xc,
break;
case XP_RELLOCPATH:
use_xr0++;
if (xs->xs_int == A_DESCENDANT_OR_SELF)
xc->xc_descendant = 1; /* XXX need to set to 0 in sub */
if (xs->xs_int == A_DESCENDANT_OR_SELF){
if (use_xr0)
xr0->xc_descendant = 1; /* XXX need to set to 0 in sub */
else
xc->xc_descendant = 1; /* XXX need to set to 0 in sub */
}
break;
case XP_NODE:
break;
@ -1347,7 +1351,10 @@ xp_eval(xp_ctx *xc,
break;
}
}
xc->xc_descendant = 0;
if (use_xr0)
xr0->xc_descendant = 0;
else
xc->xc_descendant = 0;
if (xr0 == NULL && xr1 == NULL && xr2 == NULL){
clicon_err(OE_XML, EFAULT, "Internal error: no result produced");
goto done;