* Fixed: [uses oc-if:interface-ref error with openconfig #233](https://github.com/clicon/clixon/issues/233)
This commit is contained in:
parent
85e2945ec9
commit
89f843f919
5 changed files with 24 additions and 17 deletions
|
|
@ -105,7 +105,6 @@ validate_leafref(cxobj *xt,
|
|||
{
|
||||
int retval = -1;
|
||||
yang_stmt *ypath;
|
||||
yang_stmt *yp;
|
||||
cxobj **xvec = NULL;
|
||||
cxobj *x;
|
||||
int i;
|
||||
|
|
@ -124,14 +123,8 @@ validate_leafref(cxobj *xt,
|
|||
goto fail;
|
||||
}
|
||||
/* See comment^: If path is defined in typedef or not */
|
||||
if ((yp = yang_parent_get(ytype)) != NULL &&
|
||||
yang_keyword_get(yp) == Y_TYPEDEF){
|
||||
if (xml_nsctx_yang(ys, &nsc) < 0)
|
||||
goto done;
|
||||
}
|
||||
else
|
||||
if (xml_nsctx_yang(ytype, &nsc) < 0)
|
||||
goto done;
|
||||
if (xml_nsctx_node(xt, &nsc) < 0)
|
||||
goto done;
|
||||
path = yang_argument_get(ypath);
|
||||
if (xpath_vec(xt, nsc, "%s", &xvec, &xlen, path) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -239,7 +239,6 @@ xpath_tree_print(FILE *f,
|
|||
* @param[in] xs XPATH tree
|
||||
* @param[out] xpath XPath string as CLIgen buf
|
||||
* @see xpath_tree_print
|
||||
* @note XXX Not complete
|
||||
*/
|
||||
int
|
||||
xpath_tree2cbuf(xpath_tree *xs,
|
||||
|
|
@ -247,6 +246,7 @@ xpath_tree2cbuf(xpath_tree *xs,
|
|||
{
|
||||
int retval = -1;
|
||||
|
||||
/* 1. Before first child */
|
||||
switch (xs->xs_type){
|
||||
case XP_ABSPATH:
|
||||
if (xs->xs_int == A_DESCENDANT_OR_SELF)
|
||||
|
|
@ -283,8 +283,10 @@ xpath_tree2cbuf(xpath_tree *xs,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
/* 2. First child */
|
||||
if (xs->xs_c0 && xpath_tree2cbuf(xs->xs_c0, xcb) < 0)
|
||||
goto done;
|
||||
/* 3. Between first and second child */
|
||||
switch (xs->xs_type){
|
||||
case XP_AND: /* and or */
|
||||
case XP_ADD: /* div mod + * - */
|
||||
|
|
@ -293,6 +295,13 @@ xpath_tree2cbuf(xpath_tree *xs,
|
|||
if (xs->xs_c1)
|
||||
cprintf(xcb, " %s ", clicon_int2str(xpopmap, xs->xs_int));
|
||||
break;
|
||||
case XP_PATHEXPR:
|
||||
/* [19] PathExpr ::= | FilterExpr '/' RelativeLocationPath
|
||||
| FilterExpr '//' RelativeLocationPath
|
||||
*/
|
||||
if (xs->xs_s0)
|
||||
cprintf(xcb, "%s", xs->xs_s0);
|
||||
break;
|
||||
case XP_RELLOCPATH:
|
||||
if (xs->xs_c1){
|
||||
if (xs->xs_int == A_DESCENDANT_OR_SELF)
|
||||
|
|
@ -311,8 +320,10 @@ xpath_tree2cbuf(xpath_tree *xs,
|
|||
default:
|
||||
break;
|
||||
}
|
||||
/* 4. Second child */
|
||||
if (xs->xs_c1 && xpath_tree2cbuf(xs->xs_c1, xcb) < 0)
|
||||
goto done;
|
||||
/* 5. After second child */
|
||||
switch (xs->xs_type){
|
||||
case XP_PRED:
|
||||
if (xs->xs_c1)
|
||||
|
|
@ -915,6 +926,8 @@ xpath_vec_bool(cxobj *xcur,
|
|||
return retval;
|
||||
}
|
||||
|
||||
/*!
|
||||
*/
|
||||
static int
|
||||
traverse_canonical(xpath_tree *xs,
|
||||
yang_stmt *yspec,
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ xpath_parse_exit(clixon_xpath_yacc *xpy)
|
|||
* @param[in] type XPATH tree node type
|
||||
* @param[in] i0 step-> axis_type
|
||||
* @param[in] numstr original string xs_double: numeric value
|
||||
* @param[in] s0 String 0 set if XP_PRIME_STR, XP_PRIME_FN, XP_NODE[_FN] prefix
|
||||
* @param[in] s0 String 0 set if XP_PRIME_STR, XP_PRIME_FN, XP_NODE[_FN] PATHEXPRE prefix
|
||||
* @param[in] s1 String 1 set if XP_NODE NAME
|
||||
* @param[in] c0 Child 0
|
||||
* @param[in] c1 Child 1
|
||||
|
|
@ -393,8 +393,8 @@ unionexpr : unionexpr '|' pathexpr { $$=xp_new(XP_UNION,XO_UNION,NULL,NULL,NUL
|
|||
|
||||
pathexpr : locationpath { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"pathexpr-> locationpath"); }
|
||||
| filterexpr { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"pathexpr-> filterexpr"); }
|
||||
| filterexpr '/' rellocpath { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,NULL,NULL,$1, $3);clicon_debug(3,"pathexpr-> filterexpr / rellocpath"); }
|
||||
/* Filterexpr // relativelocationpath */
|
||||
| filterexpr '/' rellocpath { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,strdup("/"),NULL,$1, $3);clicon_debug(3,"pathexpr-> filterexpr / rellocpath"); }
|
||||
| filterexpr DOUBLESLASH rellocpath { $$=xp_new(XP_PATHEXPR,A_NAN,NULL,strdup("//"),NULL,$1, $3);clicon_debug(3,"pathexpr-> filterexpr // rellocpath"); }
|
||||
;
|
||||
|
||||
filterexpr : primaryexpr { $$=xp_new(XP_FILTEREXPR,A_NAN,NULL,NULL,NULL,$1, NULL);clicon_debug(3,"filterexpr-> primaryexpr"); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue