XML: Do not add empty Value node for nodes with child nodes in TNDS

This fixes some validation issues against DM_ddf DTD that were caused by
the conversion from the internal tree structure to TNDS. Only the leaf
nodes are supposed to have the Value node.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
master
Jouni Malinen 6 years ago
parent 13dd13fc01
commit 02eec9954c

@ -246,7 +246,9 @@ static void node_to_tnds(struct xml_node_ctx *ctx, xml_node_t *out,
xml_node_create_text(ctx, tnds, NULL, "Path", uri);
val = get_val(ctx, node);
xml_node_create_text(ctx, tnds, NULL, "Value", val ? val : "");
if (val || !xml_node_first_child(ctx, node))
xml_node_create_text(ctx, tnds, NULL, "Value",
val ? val : "");
xml_node_get_text_free(ctx, val);
new_uri = add_path(uri, name);

Loading…
Cancel
Save