Bug 1022454

Summary: make the generated XML minimal
Product: [Fedora] Fedora Reporter: Ales Kozumplik <akozumpl>
Component: libcompsAssignee: Jindrich Luza <jluza>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: akozumpl, jluza, jzeleny
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-09 12:41:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ales Kozumplik 2013-10-23 10:22:57 UTC
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.

Comment 1 Jindrich Luza 2013-12-09 12:41:51 UTC
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.