json vector
This commit is contained in:
parent
363bd5d19d
commit
73074bf7a8
1 changed files with 7 additions and 15 deletions
|
|
@ -294,24 +294,16 @@ api_data_get2(clicon_handle h,
|
||||||
if (xpath_vec(xret, path, &xvec, &xlen) < 0)
|
if (xpath_vec(xret, path, &xvec, &xlen) < 0)
|
||||||
goto done;
|
goto done;
|
||||||
clicon_debug(1, "%s: xpath:%s xlen:%d", __FUNCTION__, path, xlen);
|
clicon_debug(1, "%s: xpath:%s xlen:%d", __FUNCTION__, path, xlen);
|
||||||
for (i=0; i<xlen; i++){
|
if (use_xml){
|
||||||
x = xvec[i];
|
for (i=0; i<xlen; i++){
|
||||||
#if 1 /* DEBUG */
|
x = xvec[i];
|
||||||
{
|
|
||||||
cbuf *cb = cbuf_new();
|
|
||||||
clicon_xml2cbuf(cb, x, 0, 0);
|
|
||||||
clicon_debug(1, "%s x:%s", __FUNCTION__, cbuf_get(cb));
|
|
||||||
cbuf_free(cb);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (use_xml){
|
|
||||||
if (clicon_xml2cbuf(cbx, x, 0, pretty) < 0) /* Dont print top object? */
|
if (clicon_xml2cbuf(cbx, x, 0, pretty) < 0) /* Dont print top object? */
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else{
|
}
|
||||||
if (xml2json_cbuf(cbx, x, pretty) < 0)
|
else
|
||||||
goto done;
|
if (xml2json_cbuf_vec(cbx, xvec, xlen, pretty) < 0)
|
||||||
}
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clicon_debug(1, "%s cbuf:%s", __FUNCTION__, cbuf_get(cbx));
|
clicon_debug(1, "%s cbuf:%s", __FUNCTION__, cbuf_get(cbx));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue