Bug 1022454 - make the generated XML minimal
Summary: make the generated XML minimal
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: libcomps
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jindrich Luza
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-23 10:22 UTC by Ales Kozumplik
Modified: 2014-09-30 23:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-09 12:41:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.