* 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:
parent
71efe18f94
commit
7425a3b520
26 changed files with 135 additions and 155 deletions
|
|
@ -145,7 +145,8 @@ xml_copy_marked(cxobj *x0,
|
|||
|
||||
assert(x0 && x1);
|
||||
yt = xml_spec(x0); /* can be null */
|
||||
/* Copy prefix*/
|
||||
xml_spec_set(x1, yt);
|
||||
/* Copy prefix*/
|
||||
if ((prefix = xml_prefix(x0)) != NULL)
|
||||
if (xml_prefix_set(x1, prefix) < 0)
|
||||
goto done;
|
||||
|
|
@ -154,7 +155,7 @@ xml_copy_marked(cxobj *x0,
|
|||
x = NULL;
|
||||
while ((x = xml_child_each(x0, x, CX_ATTR)) != NULL) {
|
||||
name = xml_name(x);
|
||||
if ((xcopy = xml_new(name, x1, xml_spec(x))) == NULL)
|
||||
if ((xcopy = xml_new(name, NULL, x1, CX_ATTR)) == NULL)
|
||||
goto done;
|
||||
if (xml_copy(x, xcopy) < 0)
|
||||
goto done;
|
||||
|
|
@ -177,7 +178,7 @@ xml_copy_marked(cxobj *x0,
|
|||
name = xml_name(x);
|
||||
if (xml_flag(x, XML_FLAG_MARK)){
|
||||
/* (2) the complete subtree of that node is copied. */
|
||||
if ((xcopy = xml_new(name, x1, xml_spec(x))) == NULL)
|
||||
if ((xcopy = xml_new(name, NULL, x1, CX_ELMNT)) == NULL)
|
||||
goto done;
|
||||
if (xml_copy(x, xcopy) < 0)
|
||||
goto done;
|
||||
|
|
@ -185,7 +186,7 @@ xml_copy_marked(cxobj *x0,
|
|||
}
|
||||
if (xml_flag(x, XML_FLAG_CHANGE)){
|
||||
/* Copy individual nodes marked with XML_FLAG_CHANGE */
|
||||
if ((xcopy = xml_new(name, x1, xml_spec(x))) == NULL)
|
||||
if ((xcopy = xml_new(name, NULL, x1, CX_ELMNT)) == NULL)
|
||||
goto done;
|
||||
if (xml_copy_marked(x, xcopy) < 0) /* */
|
||||
goto done;
|
||||
|
|
@ -197,7 +198,7 @@ xml_copy_marked(cxobj *x0,
|
|||
if ((iskey = yang_key_match(yt, name)) < 0)
|
||||
goto done;
|
||||
if (iskey){
|
||||
if ((xcopy = xml_new(name, x1, xml_spec(x))) == NULL)
|
||||
if ((xcopy = xml_new(name, NULL, x1, CX_ELMNT)) == NULL)
|
||||
goto done;
|
||||
if (xml_copy(x, xcopy) < 0)
|
||||
goto done;
|
||||
|
|
@ -537,8 +538,10 @@ xmldb_get_cache(clicon_handle h,
|
|||
goto done;
|
||||
|
||||
/* Make new tree by copying top-of-tree from x0t to x1t */
|
||||
if ((x1t = xml_new(xml_name(x0t), NULL, xml_spec(x0t))) == NULL)
|
||||
if ((x1t = xml_new(xml_name(x0t), NULL, NULL, CX_ELMNT)) == NULL)
|
||||
goto done;
|
||||
xml_spec_set(x1t, xml_spec(x0t));
|
||||
|
||||
/* Iterate through the match vector
|
||||
* For every node found in x0, mark the tree up to t1
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue