From 4188bd899fd22de5bd5f7c894d31e8c2cc51a764 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Fri, 29 Jun 2018 09:39:43 +0000 Subject: [PATCH] Feature: Add definition ID to the first child of generated reports --- src/reportxml.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/reportxml.c b/src/reportxml.c index a0906547..c4974b73 100644 --- a/src/reportxml.c +++ b/src/reportxml.c @@ -1288,6 +1288,11 @@ reportxml_t * reportxml_database_build_report(reportxml_database_t *db for (i = 0; i < (size_t)count; i++) { child = reportxml_node_get_child(definition, i); + if (i == 0) { + /* Attach definition to the first child only. */ + reportxml_node_set_attribute(child, "definition", id); + } + /* we can directly attach as it's a already a copy. */ if (reportxml_node_add_child(attach_to, child) != 0) { refobject_unref(definition);