Skip to content

Commit

Permalink
Fixed template substitution to work in attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Dec 3, 2024
1 parent 462b18e commit 379644a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/src/clixon_xml_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -2419,12 +2419,21 @@ xml_template_apply(cxobj *x,
{
int retval = -1;
cvec *cvv = (cvec *)arg;
cxobj *xb;
cxobj *xb = NULL;
char *b;
cbuf *cb = NULL;

if ((xb = xml_body_get(x)) != NULL &&
(b = xml_value(xb)) != NULL){
switch (xml_type(x)){
case CX_ELMNT:
xb = xml_body_get(x);
break;
case CX_ATTR:
xb = x;
break;
default:
break;
}
if (xb && (b = xml_value(xb)) != NULL){
if ((cb = cbuf_new()) == NULL){
clixon_err(OE_UNIX, errno, "cbuf_new");
goto done;
Expand Down

0 comments on commit 379644a

Please sign in to comment.