]> mj.ucw.cz Git - libucw.git/commit
XML: Changed internal representation of attributes
authorMartin Mares <mj@ucw.cz>
Thu, 12 Feb 2015 23:24:26 +0000 (00:24 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 12 Feb 2015 23:24:26 +0000 (00:24 +0100)
commite16fbdbeaeefc2b01ad1ed71d63ed98530bcbae5
treef12642be90c29ae79b518a75b34c402d2c078416
parentcdfd7b57bf6a48708ea5e490a0b5f61d387fb41a
XML: Changed internal representation of attributes

As most elements have only a couple of attributes, I switched the
main attribute data structure from a hash table to a list. String
comparisons are hopefully avoided in most cases, as we keep a hash
of the lookup key in each entry.

More importantly, the structure is populated in two steps: first,
original (i.e., qualified) names of all attributes are entered;
second, namespaces are resolved and attributes are checked for
uniqueness.

If linear time complexity of attribute lookups turns out to be
too slow, we can add a secondary hash table for elements with
many attributes. This table will be populated from the list
in the 2nd step above.
ucw-xml/common.c
ucw-xml/internals.h
ucw-xml/parse.c
ucw-xml/xml.h