Merge branch 'fix-xpath-select' of https://github.com/baruchsiach/clixon into baruchsiach-fix-xpath-select
This commit is contained in:
commit
aefc84892b
1 changed files with 13 additions and 3 deletions
|
|
@ -1343,6 +1343,7 @@ xml_find_index_yang(cxobj *xp,
|
||||||
cg_var *ycv = NULL;
|
cg_var *ycv = NULL;
|
||||||
int i;
|
int i;
|
||||||
char *name;
|
char *name;
|
||||||
|
char *encstr;
|
||||||
int revert = 0;
|
int revert = 0;
|
||||||
char *indexvar = NULL;
|
char *indexvar = NULL;
|
||||||
|
|
||||||
|
|
@ -1377,7 +1378,10 @@ xml_find_index_yang(cxobj *xp,
|
||||||
revert++;
|
revert++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
cprintf(cb, "<%s>%s</%s>", kname, cv_string_get(cvi), kname);
|
if (xml_chardata_encode(&encstr, "%s", cv_string_get(cvi)) < 0)
|
||||||
|
goto done;
|
||||||
|
cprintf(cb, "<%s>%s</%s>", kname, encstr, kname);
|
||||||
|
free(encstr);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (revert)
|
if (revert)
|
||||||
|
|
@ -1390,7 +1394,10 @@ xml_find_index_yang(cxobj *xp,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
cvi = cvec_i(cvk, 0);
|
cvi = cvec_i(cvk, 0);
|
||||||
cprintf(cb, "<%s>%s</%s>", name, cv_string_get(cvi), name);
|
if (xml_chardata_encode(&encstr, "%s", cv_string_get(cvi)) < 0)
|
||||||
|
goto done;
|
||||||
|
cprintf(cb, "<%s>%s</%s>", name, encstr, name);
|
||||||
|
free(encstr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
cprintf(cb, "<%s/>", name);
|
cprintf(cb, "<%s/>", name);
|
||||||
|
|
@ -1407,7 +1414,10 @@ xml_find_index_yang(cxobj *xp,
|
||||||
yang_flag_get(yi, YANG_FLAG_INDEX) == 0)
|
yang_flag_get(yi, YANG_FLAG_INDEX) == 0)
|
||||||
goto revert;
|
goto revert;
|
||||||
cbuf_reset(cb);
|
cbuf_reset(cb);
|
||||||
cprintf(cb, "<%s><%s>%s</%s></%s>", name, iname, cv_string_get(cvi), iname, name);
|
if (xml_chardata_encode(&encstr, "%s", cv_string_get(cvi)) < 0)
|
||||||
|
goto done;
|
||||||
|
cprintf(cb, "<%s><%s>%s</%s></%s>", name, iname, encstr, iname, name);
|
||||||
|
free(encstr);
|
||||||
indexvar = iname;
|
indexvar = iname;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue