* C-API change: xml_new() changed from xml_new(name, xp, ys) to xml_new(name, prefix, xp, type)

* If you have used, `ys`, add `xml_spec_set(x, ys)` after the statement
  * If you have `xml_type_set(x, TYPE)` or `xml_prefix_set(x, PREFIX)` immediately after the statement, you can remove those and set them directly as: `xml_new(name, PREFIX, xp, TYPE)`
This commit is contained in:
Olof hagsand 2020-03-12 22:29:28 +01:00
parent 71efe18f94
commit 7425a3b520
26 changed files with 135 additions and 155 deletions

View file

@ -200,9 +200,8 @@ dbxml_body(cxobj *xbot,
clicon_err(OE_UNIX, errno, "cv2str_dup");
goto done;
}
if ((xb = xml_new("body", xbot, NULL)) == NULL)
if ((xb = xml_new("body", NULL, xbot, CX_BODY)) == NULL)
goto done;
xml_type_set(xb, CX_BODY);
if (xml_value_set(xb, str) < 0)
goto done;
retval = 0;
@ -259,7 +258,7 @@ cli_dbxml(clicon_handle h,
if (api_path_fmt2api_path(api_path_fmt, cvv, &api_path) < 0)
goto done;
/* Create config top-of-tree */
if ((xtop = xml_new("config", NULL, NULL)) == NULL)
if ((xtop = xml_new("config", NULL, NULL, CX_ELMNT)) == NULL)
goto done;
xbot = xtop;
if (api_path){
@ -277,10 +276,8 @@ cli_dbxml(clicon_handle h,
goto done;
}
}
if ((xa = xml_new("operation", xbot, NULL)) == NULL)
if ((xa = xml_new("operation", NETCONF_BASE_PREFIX, xbot, CX_ATTR)) == NULL)
goto done;
xml_type_set(xa, CX_ATTR);
xml_prefix_set(xa, NETCONF_BASE_PREFIX);
if (xml_value_set(xa, xml_operation2str(op)) < 0)
goto done;
if (yang_keyword_get(y) != Y_LIST && yang_keyword_get(y) != Y_LEAF_LIST){
@ -1234,7 +1231,7 @@ cli_copy_config(clicon_handle h,
}
toname = cv_string_get(tocv);
/* Create copy xml tree x2 */
if ((x2 = xml_new("new", NULL, NULL)) == NULL)
if ((x2 = xml_new("config", NULL, NULL, CX_ELMNT)) == NULL)
goto done;
if (xml_copy(x1, x2) < 0)
goto done;