Red Hat Bugzilla – Bug 1022454
make the generated XML minimal
Last modified: 2014-09-30 19:41:51 EDT
Description of problem:
libcomps currently writes out attributes of elements even if they're set to their default value, e.g. the <uservisible>. This makes the generated .xml file bigger than necessary which is undesirable if libcomps is ever going to become the library to generate comps files in the Fedora repos.
The DTD for comps should be updated to correctly reflect all the defaults, libcomps should either always generate the minimal XML possible or have a switch that includes/excldudes implicit values.
xml_options and def_options arguments will be in new version of libcomps.
- def_options is structure passed to parse_* function telling parser which value will be used in case of missing attribute/element.
- xml_options is structure indicating how xml output will looks (like explicit containment of some attributes in output, empty groups/categories/environments output etc.)
- def_options used in xml_* functions indicates default values of parser. That means if generated X value is equal default X value in def_options and X_explicit flag in xml_options is false, output of X value will be omitted.
Finaly if neither def_options nor xml_options is passed to parse_* or xml_* functions, default versions of this structures will be used.