Fixed: [Returning a string while Querying leaf-list for single entry](https://github.com/clicon/clixon/issues/326)
This commit is contained in:
parent
7065d6f760
commit
0c81b66ef3
6 changed files with 66 additions and 8 deletions
|
|
@ -145,12 +145,20 @@ main(int argc,
|
|||
xml_print(stderr, xerr);
|
||||
goto done;
|
||||
}
|
||||
#if 0
|
||||
if (json)
|
||||
xml2json_cbuf(cb, xt, pretty); /* print json */
|
||||
else
|
||||
clicon_xml2cbuf(cb, xt, 0, pretty, -1); /* print xml */
|
||||
#else
|
||||
xc = NULL;
|
||||
/* XXX This is troublesome for JSON top-level lists */
|
||||
while ((xc = xml_child_each(xt, xc, -1)) != NULL)
|
||||
if (json)
|
||||
xml2json_cbuf(cb, xc, pretty); /* print xml */
|
||||
xml2json_cbuf(cb, xc, pretty); /* print json */
|
||||
else
|
||||
clicon_xml2cbuf(cb, xc, 0, pretty, -1); /* print xml */
|
||||
#endif
|
||||
fprintf(stdout, "%s", cbuf_get(cb));
|
||||
fflush(stdout);
|
||||
retval = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue