builder-tool: Don't strip the xml declaration

This is useful for interoperability with other tools.
This commit is contained in:
Matthias Clasen 2019-03-28 19:28:05 -04:00
parent 7222bda146
commit c30fc92b3e

View File

@ -1264,9 +1264,16 @@ dump_element (Element *element,
g_fprintf (output, "/>\n");
}
static void
write_xml_declaration (FILE *output)
{
g_fprintf (output, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
}
static void
dump_tree (MyParserData *data)
{
write_xml_declaration (data->output);
dump_element (data->root, data->output, 0);
}