Removed prefix parameter to xml_new

Added xml_new_body() by mgsmith
This commit is contained in:
Olof hagsand 2020-03-17 11:18:22 +01:00
parent d36ab2e093
commit c5e2039cac
26 changed files with 167 additions and 113 deletions

View file

@ -179,8 +179,11 @@ json_current_new(clixon_json_yacc *jy,
/* Find colon separator and if found split into prefix:name */
if (nodeid_split(name, &prefix, &id) < 0)
goto done;
if ((x = xml_new(id, prefix, jy->jy_current, CX_ELMNT)) == NULL)
goto done;
if ((x = xml_new(id, jy->jy_current, CX_ELMNT)) == NULL)
goto done;
if (xml_prefix_set(x, prefix) < 0)
goto done;
/* If topmost, add to top-list created list */
if (jy->jy_current == jy->jy_xtop){
if (cxvec_append(x, &jy->jy_xvec, &jy->jy_xlen) < 0)
@ -227,7 +230,7 @@ json_current_body(clixon_json_yacc *jy,
cxobj *xn;
clicon_debug(2, "%s", __FUNCTION__);
if ((xn = xml_new("body", NULL, jy->jy_current, CX_BODY)) == NULL)
if ((xn = xml_new("body", jy->jy_current, CX_BODY)) == NULL)
goto done;
if (value && xml_value_append(xn, value) < 0)
goto done;