[Libosinfo] [libosinfo 0/4]
Christophe Fergeau
cfergeau at redhat.com
Wed Nov 6 13:41:49 UTC 2013
Hey,
In order to support the <foo/> syntax to represent booleans in libosinfo databases,
some changes are needed in the OsinfoLoader parser in order for it to be able to parse
empty nodes when needed (see patch 2/4 for details). These patches do the needed changes,
and adjust the libosinfo database to use the shorter syntax for booleans.
The older syntax is still supported.
An alternative to this patch would be to modify osinfo_loader_string() so that it
can make the difference between non-existing nodes, and empty ones. Handling booleans through
a new osinfo_loader_boolean() has the advantage that all booleans are stored the same way in
the in-memory OsinfoDb. If we change osinfo_loader_string(), some booleans will be stored as
("foo", "true") while others will be stored as ("foo", "") depending on how they are represented
in the XML.
One last note, the schema change could be improved a little bit, as we have some attributes marked
as booleans. The schema allows for an empty value to mean 'true', so <foo bar=""> will now be accepted
and be the same as <foo bar="true">. We could have 2 'bool' definitions in the schema for nodes and
attributes, but that seemed a bit too much.
Christophe
More information about the Libosinfo
mailing list