* 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
|
|
@ -108,9 +108,8 @@ xml_parse_content(clixon_xml_yacc *xy,
|
|||
|
||||
xy->xy_xelement = NULL; /* init */
|
||||
if (xn == NULL){
|
||||
if ((xn = xml_new("body", xp, NULL)) == NULL)
|
||||
if ((xn = xml_new("body", NULL, xp, CX_BODY)) == NULL)
|
||||
goto done;
|
||||
xml_type_set(xn, CX_BODY);
|
||||
}
|
||||
if (xml_value_append(xn, str) < 0)
|
||||
goto done;
|
||||
|
|
@ -145,9 +144,8 @@ xml_parse_whitespace(clixon_xml_yacc *xy,
|
|||
goto ok; /* Skip if already element */
|
||||
}
|
||||
if (xn == NULL){
|
||||
if ((xn = xml_new("body", xp, NULL)) == NULL)
|
||||
if ((xn = xml_new("body", NULL, xp, CX_BODY)) == NULL)
|
||||
goto done;
|
||||
xml_type_set(xn, CX_BODY);
|
||||
}
|
||||
if (xml_value_append(xn, str) < 0)
|
||||
goto done;
|
||||
|
|
@ -189,10 +187,7 @@ xml_parse_prefixed_name(clixon_xml_yacc *xy,
|
|||
cxobj *xp; /* xml parent */
|
||||
|
||||
xp = xy->xy_xparent;
|
||||
if ((x = xml_new(name, xp, NULL)) == NULL)
|
||||
goto done;
|
||||
xml_type_set(x, CX_ELMNT);
|
||||
if (prefix && xml_prefix_set(x, prefix) < 0)
|
||||
if ((x = xml_new(name, prefix, xp, CX_ELMNT)) == NULL)
|
||||
goto done;
|
||||
xy->xy_xelement = x;
|
||||
/* If topmost, add to top-list created list */
|
||||
|
|
@ -305,10 +300,7 @@ xml_parse_attr(clixon_xml_yacc *xy,
|
|||
cxobj *xa = NULL;
|
||||
|
||||
if ((xa = xml_find_type(xy->xy_xelement, prefix, name, CX_ATTR)) == NULL){
|
||||
if ((xa = xml_new(name, xy->xy_xelement, NULL)) == NULL)
|
||||
goto done;
|
||||
xml_type_set(xa, CX_ATTR);
|
||||
if (prefix && xml_prefix_set(xa, prefix) < 0)
|
||||
if ((xa = xml_new(name, prefix, xy->xy_xelement, CX_ATTR)) == NULL)
|
||||
goto done;
|
||||
}
|
||||
if (xml_value_set(xa, attval) < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue